|
|
@ -68,12 +68,14 @@ class Api::BaseController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def require_user! |
|
|
|
def require_user! |
|
|
|
if current_user && !current_user.disabled? && current_user.confirmed? |
|
|
|
if !current_user |
|
|
|
set_user_activity |
|
|
|
render json: { error: 'This method requires an authenticated user' }, status: 422 |
|
|
|
elsif current_user |
|
|
|
elsif current_user.disabled? |
|
|
|
render json: { error: 'Your login is currently disabled' }, status: 403 |
|
|
|
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 |
|
|
|
else |
|
|
|
render json: { error: 'This method requires an authenticated user' }, status: 422 |
|
|
|
set_user_activity |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|