Skip to content
Snippets Groups Projects

Fixed Wrong Tab Selected When Loggin Fails And Multiple Login Tabs Exists

2 unresolved threads
8 files
+ 107
17
Compare changes
  • Side-by-side
  • Inline
Files
8
  • When ldap is enabled and use "Standard" authentication method, if authentication fails
    the correct tab remain selected.
    Also Handled when you activate "Crowd" and login with LDAP or Standard, if the authentication
    fails the correct tab remain selected.
    This is done by saving into temporary session the last failure_auth_method used and showing
    the correct tab depending on that.
@@ -9,6 +9,14 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
@@ -9,6 +9,14 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
end
end
end
 
# Override `OmniauthCallbacksController#failure` to temporary save the last
 
# failure_authentication_method used.
 
# This is needed in order to show the correct tab after a failed login attempt
 
def failure
 
flash[:failure_auth_method] = failed_strategy.name
 
super
 
end
 
# Extend the standard message generation to accept our custom exception
# Extend the standard message generation to accept our custom exception
def failure_message
def failure_message
exception = env["omniauth.error"]
exception = env["omniauth.error"]
Loading