From 083ed716be0132ddd4a3c009d250732ff9e06a59 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 2 Feb 2025 13:06:30 +0100 Subject: [PATCH] Skip token refrash without refresh token in psa Probably fixes https://github.com/galaxyproject/galaxy/issues/19513 --- lib/galaxy/authnz/psa_authnz.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/authnz/psa_authnz.py b/lib/galaxy/authnz/psa_authnz.py index c1299966a839..20bd8ca9a88d 100644 --- a/lib/galaxy/authnz/psa_authnz.py +++ b/lib/galaxy/authnz/psa_authnz.py @@ -177,7 +177,11 @@ def refresh_azure(self, user_authnz_token): user_authnz_token.set_extra_data(extra_data) def refresh(self, trans, user_authnz_token): - if not user_authnz_token or not user_authnz_token.extra_data: + if ( + not user_authnz_token + or not user_authnz_token.extra_data + or "refresh_token" not in user_authnz_token.extra_data + ): return False # refresh tokens if they reached their half lifetime if "expires" in user_authnz_token.extra_data: