Class: Spree::Admin::UserSessionsController
- Inherits:
-
Devise::SessionsController
- Object
- Devise::SessionsController
- Spree::Admin::UserSessionsController
- Includes:
- Core::ControllerHelpers::Auth, Core::ControllerHelpers::Common, Core::ControllerHelpers::Store
- Defined in:
- lib/controllers/backend/spree/admin/user_sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#authorization_failure ⇒ Object
31 32 33 34 35 |
# File 'lib/controllers/backend/spree/admin/user_sessions_controller.rb', line 31 def return if try_spree_current_user store_location return redirect_to spree.admin_login_path end |
#create ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/controllers/backend/spree/admin/user_sessions_controller.rb', line 11 def create authenticate_spree_user! if spree_user_signed_in? respond_to do |format| format.html { flash[:success] = Spree.t(:logged_in_succesfully) redirect_back_or_default(after_sign_in_path_for(spree_current_user)) } format.js { user = resource.record render json: { ship_address: user.ship_address, bill_address: user.bill_address }.to_json } end else flash.now[:error] = t('devise.failure.invalid') render :new end end |