From b805aafbe64df273bdeca533fc992db3addb6810 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 21 Jan 2020 14:37:24 -0500 Subject: [PATCH] Fix custos auth bug when the user is already signed in. --- lib/galaxy/authnz/custos_authnz.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/authnz/custos_authnz.py b/lib/galaxy/authnz/custos_authnz.py index 044b342b50c..54ce96ee389 100644 --- a/lib/galaxy/authnz/custos_authnz.py +++ b/lib/galaxy/authnz/custos_authnz.py @@ -88,7 +88,8 @@ class CustosAuthnz(IdentityProvider): # Create or update custos_authnz_token record custos_authnz_token = self._get_custos_authnz_token(trans.sa_session, user_id, self.config['provider']) if custos_authnz_token is None: - if not trans.user: + user = trans.user + if not user: existing_user = trans.sa_session.query(User).filter_by(email=email).first() if existing_user: # If there is only a single external authentication