Class: Spree::Admin::UserSessionsController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/spree/admin/user_sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#create {|resource| ... } ⇒ Object

We need to overwrite this action because ‘return_to` url may be in a different domain So we need to pass `allow_other_host` option to `redirect_to` method

Yields:

  • (resource)


8
9
10
11
12
13
14
# File 'app/controllers/spree/admin/user_sessions_controller.rb', line 8

def create
  self.resource = warden.authenticate!(auth_options)
  set_flash_message!(:notice, :signed_in)
  (resource_name, resource)
  yield resource if block_given?
  redirect_to (resource), allow_other_host: true
end