Class: Spree::UserSessionsController
- Inherits:
-
Devise::SessionsController
- Object
- Devise::SessionsController
- Spree::UserSessionsController
- Includes:
- Core::ControllerHelpers, SslRequirement
- Defined in:
- app/controllers/spree/user_sessions_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#new ⇒ Object
GET /resource/sign_in.
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/controllers/spree/user_sessions_controller.rb', line 29 def create #super authenticate_refinery_user! if refinery_user_signed_in? respond_to do |format| format.html { flash[:success] = t(:logged_in_succesfully) redirect_back_or_default(after_sign_in_path_for(current_refinery_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 |
#destroy ⇒ Object
50 51 52 53 54 |
# File 'app/controllers/spree/user_sessions_controller.rb', line 50 def destroy .clear session.clear super end |
#new ⇒ Object
GET /resource/sign_in
16 17 18 19 |
# File 'app/controllers/spree/user_sessions_controller.rb', line 16 def new @user = Refinery::User.new super end |