diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-04-23 02:05:12 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-05-04 17:00:59 +0300 |
commit | 7425f2b32217f71f99ff8642664a6642dfaeff87 (patch) | |
tree | a81aaf750854d72d1c1c446a52c1b70392300308 | |
parent | 4bf47cd76fd69a26b7b2b4ac029f088ec5493712 (diff) |
Backport IdentityLinker#failed? from GroupSaml callback flow
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/auth/omniauth_identity_linker_base.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 40d9fa18a10..ed89bed029b 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -82,7 +82,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController if identity_linker.changed? redirect_identity_linked - elsif identity_linker.error_message.present? + elsif identity_linker.failed? redirect_identity_link_failed(identity_linker.error_message) else redirect_identity_exists diff --git a/lib/gitlab/auth/omniauth_identity_linker_base.rb b/lib/gitlab/auth/omniauth_identity_linker_base.rb index ae365fcdfaa..f79ce6bb809 100644 --- a/lib/gitlab/auth/omniauth_identity_linker_base.rb +++ b/lib/gitlab/auth/omniauth_identity_linker_base.rb @@ -17,6 +17,10 @@ module Gitlab @changed end + def failed? + error_message.present? + end + def error_message identity.validate |