Class: SesDashboard::Auth::DeviseAdapter

Inherits:
Base
  • Object
show all
Defined in:
lib/ses_dashboard/auth/devise_adapter.rb

Instance Method Summary collapse

Methods inherited from Base

#call

Constructor Details

#initialize(app = nil, controller: nil) ⇒ DeviseAdapter

Returns a new instance of DeviseAdapter.



4
5
6
7
# File 'lib/ses_dashboard/auth/devise_adapter.rb', line 4

def initialize(app = nil, controller: nil)
  super(app)
  @controller = controller
end

Instance Method Details

#authenticate(request = nil) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/ses_dashboard/auth/devise_adapter.rb', line 9

def authenticate(request = nil)
  return false unless controller
  controller.authenticate_user!
  !controller.current_user.nil?
rescue StandardError
  false
end