Class: OpenStax::Accounts::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- OpenStax::Accounts::SessionsController
- Defined in:
- app/controllers/openstax/accounts/sessions_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#destroy ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/openstax/accounts/sessions_controller.rb', line 22 def destroy sign_out! # If we're using the Accounts server, need to sign out of it so can't # log back in automagically redirect_to OpenStax::Accounts.configuration.enable_stubbing? ? return_url : OpenStax::Utilities.generate_url( OpenStax::Accounts.configuration.openstax_accounts_url + "/logout", return_to: return_url ) end |
#failure ⇒ Object
35 36 37 |
# File 'app/controllers/openstax/accounts/sessions_controller.rb', line 35 def failure redirect_to return_url, alert: "Authentication failed, please try again." end |
#new ⇒ Object
5 6 7 8 |
# File 'app/controllers/openstax/accounts/sessions_controller.rb', line 5 def new session[:return_to] ||= request.referrer redirect_to RouteHelper.get_path(:login) end |
#omniauth_authenticated ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/openstax/accounts/sessions_controller.rb', line 10 def omniauth_authenticated handle_with(SessionsOmniauthAuthenticated, success: lambda { sign_in(@handler_result.outputs[:accounts_user_to_sign_in]) # referrer is in Accounts, so don't include it redirect_to return_url }, failure: lambda { failure }) end |