Last active
August 29, 2015 14:15
-
-
Save dchandekstark/2f5825fb5a44f2cc56e9 to your computer and use it in GitHub Desktop.
SessionsController - Devise + Ominauth + Shibboleth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::SessionsController < Devise::SessionsController | |
def new | |
store_location_for(:user, request.referrer) # return to previous page after authn | |
if Ddr::Auth.require_shib_user_authn | |
# don't want the "sign in or sign up" flash in this case | |
flash.discard(:alert) | |
redirect_to user_omniauth_authorize_path(:shibboleth) | |
else | |
super | |
end | |
end | |
def after_sign_out_path_for(scope) | |
return Ddr::Auth.sso_logout_url if Ddr::Auth.require_shib_user_authn | |
super | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment