summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/users_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 7ce4a75ffc1..6931a553205 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,6 +1,6 @@
class UsersController < ApplicationController
skip_before_action :authenticate_user!
- before_action :user
+ before_action :user, except: [:exists]
before_action :authorize_read_user!, only: [:show]
def show
@@ -86,7 +86,7 @@ class UsersController < ApplicationController
end
def exists
- render json: { exists: !user.nil? }
+ render json: { exists: !User.find_by_username(params[:username]).nil? }
end
private