Module: RailsJwtAuth::WardenHelper

Defined in:
app/helpers/rails_jwt_auth/warden_helper.rb

Instance Method Summary collapse

Instance Method Details

#authenticate!Object



15
16
17
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 15

def authenticate!
  warden.authenticate!
end

#current_userObject



7
8
9
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 7

def current_user
  warden.user
end

#render_401Object



19
20
21
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 19

def render_401
  render json: {}, status: 401
end

#signed_in?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 3

def signed_in?
  !current_user.nil?
end

#wardenObject



11
12
13
# File 'app/helpers/rails_jwt_auth/warden_helper.rb', line 11

def warden
  request.env['warden']
end