mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Merge pull request #10199 from juleengraham/existing-acct-error
Display proper clientside error
This commit is contained in:
@@ -108,7 +108,7 @@ class CustosAuthnz(IdentityProvider):
|
||||
len(trans.app.auth_manager.authenticators) == 0):
|
||||
user = existing_user
|
||||
else:
|
||||
message = 'There already exists a user this email. To associate this external login, you must first be logged in as that existing account.'
|
||||
message = "There already exists a user with email %s. To associate this external login, you must first be logged in as that existing account." % email
|
||||
log.exception(message)
|
||||
raise exceptions.AuthenticationFailed(message)
|
||||
else:
|
||||
|
||||
@@ -297,9 +297,8 @@ class AuthnzManager:
|
||||
if success is False:
|
||||
return False, message, (None, None)
|
||||
return success, message, backend.callback(state_token, authz_code, trans, login_redirect_url)
|
||||
except exceptions.AuthenticationFailed as e:
|
||||
log.exception(e.message)
|
||||
raise exceptions.AuthenticationFailed(e.message)
|
||||
except exceptions.AuthenticationFailed:
|
||||
raise
|
||||
except Exception as e:
|
||||
msg = 'The following error occurred when handling callback from `{}` identity provider: ' \
|
||||
'{}'.format(provider, str(e))
|
||||
|
||||
@@ -82,8 +82,8 @@ class OIDC(JSAppLauncher):
|
||||
trans,
|
||||
login_redirect_url=url_for('/'),
|
||||
idphint=idphint)
|
||||
except exceptions.AuthenticationFailed as e:
|
||||
return trans.response.send_redirect(trans.request.base + url_for('/') + 'root/login?message=' + (e.message or "Duplicate Email"))
|
||||
except exceptions.AuthenticationFailed:
|
||||
raise
|
||||
if success is False:
|
||||
return trans.show_error_message(message)
|
||||
user = user if user is not None else trans.user
|
||||
|
||||
Reference in New Issue
Block a user