0
0
Fork 0

New variable OAUTH_REDIRECT_AT_SIGN_IN + Ref #6538 (not only SAML strategies) (#6540)

This commit is contained in:
Ghislain Loaec 2018-02-23 01:16:17 +01:00 committed by Eugen Rochko
parent 8fa924e372
commit e668180044
4 changed files with 20 additions and 4 deletions

View file

@ -10,6 +10,15 @@ class Auth::SessionsController < Devise::SessionsController
prepend_before_action :authenticate_with_two_factor, if: :two_factor_enabled?, only: [:create]
before_action :set_instance_presenter, only: [:new]
def new
Devise.omniauth_configs.each do |provider, config|
if config.strategy.redirect_at_sign_in
return redirect_to(omniauth_authorize_path(resource_name, provider))
end
end
super
end
def create
super do |resource|
remember_me(resource)