Backport IdentityLinker#failed? from GroupSaml callback flow

This commit is contained in:
James Edwards-Jones 2018-04-23 00:05:12 +01:00
parent 4bf47cd76f
commit 7425f2b322
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -17,6 +17,10 @@ module Gitlab
@changed
end
def failed?
error_message.present?
end
def error_message
identity.validate