From a2f9f6aa0dfe3b33f0d1dac2c9296fb022899cc4 Mon Sep 17 00:00:00 2001 From: Greg Finak Date: Fri, 13 Aug 2021 14:55:13 -0700 Subject: [PATCH] Catch a ValueError that is uncaught when credentials_store is missing a token key --- flask_oidc/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flask_oidc/__init__.py b/flask_oidc/__init__.py index 6ea1520..a68d05f 100644 --- a/flask_oidc/__init__.py +++ b/flask_oidc/__init__.py @@ -439,6 +439,10 @@ def authenticate_or_redirect(self): logger.debug("Expired ID token, credentials missing", exc_info=True) return self.redirect_to_auth_server(request.url) + except ValueError: + logger.debug("Credentials missing", + exc_info=True) + return self.redirect_to_auth_server(request.url) # refresh and store credentials try: