check current user session
This commit is contained in:
@@ -33,10 +33,10 @@ module LoginVerification
|
||||
protected
|
||||
# Authenticate the user with token based authentication
|
||||
def authenticate
|
||||
authenticate_session_token || render_unauthorized
|
||||
authenticate_session_token || render_unauthorized
|
||||
end
|
||||
|
||||
def authenticate_session_token
|
||||
def authenticate_session_token
|
||||
token = session[:session_token]
|
||||
if (token)
|
||||
#@current_user = User.find_by(api_key: token)
|
||||
@@ -50,7 +50,7 @@ module LoginVerification
|
||||
end
|
||||
end
|
||||
|
||||
def render_unauthorized()
|
||||
def render_unauthorized
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user