Class: Spree::Admin::UserSessionsController

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

Constant Summary

Constants included from LocaleConcern

LocaleConcern::ADMIN_LOCALE_COOKIE

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)


22
23
24
25
26
27
28
# File 'app/controllers/spree/admin/user_sessions_controller.rb', line 22

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