diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2019-05-06 19:18:03 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2019-05-06 19:28:27 +0300 |
commit | 651cfd08abe10a4bf33962a8e820aa4ed404fb46 (patch) | |
tree | 83af222ac2b682fe0653eadb87eec7561bfcc9fc /app/controllers | |
parent | 8b55b794cb48c726cde7cf0ad24180d8e6bb975f (diff) |
CE changes for SSO web enforcement
Adds two methods for us to extend in EE:
- OmniauthCallbacksController#link_identity
- GroupPolicy#lookup_access_level!
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index d9b3b4bbbd9..2a8dd997d04 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -86,7 +86,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController log_audit_event(current_user, with: oauth['provider']) identity_linker ||= auth_module::IdentityLinker.new(current_user, oauth) - identity_linker.link + + link_identity(identity_linker) if identity_linker.changed? redirect_identity_linked @@ -100,6 +101,10 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController end end + def link_identity(identity_linker) + identity_linker.link + end + def redirect_identity_exists redirect_to after_sign_in_path_for(current_user) end |