Skip to content
Snippets Groups Projects
Commit bf70e5cf authored by Takeshi Umeda's avatar Takeshi Umeda Committed by Eugen Rochko
Browse files

Add error message with invalid email confirmation (#9625)

parent 6641a1ca
No related branches found
No related tags found
No related merge requests found
......@@ -68,12 +68,14 @@ class Api::BaseController < ApplicationController
end
def require_user!
if current_user && !current_user.disabled? && current_user.confirmed?
set_user_activity
elsif current_user
if !current_user
render json: { error: 'This method requires an authenticated user' }, status: 422
elsif current_user.disabled?
render json: { error: 'Your login is currently disabled' }, status: 403
elsif !current_user.confirmed?
render json: { error: 'Email confirmation is not completed' }, status: 403
else
render json: { error: 'This method requires an authenticated user' }, status: 422
set_user_activity
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment