From 33ebb1f4e5578ac02a8dc69b40a657f27b33b962 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Fri, 19 Jul 2024 12:29:43 +0200 Subject: [PATCH] Fix error with no renew token --- app/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index dfd525547..93b1c40ff 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -38,7 +38,7 @@ from app.ott import OneTimeTokenData from app import utils, appdb, db from app.vault_info import VaultInfo -from oauthlib.oauth2.rfc6749.errors import InvalidTokenError, TokenExpiredError, InvalidGrantError +from oauthlib.oauth2.rfc6749.errors import InvalidTokenError, TokenExpiredError, InvalidGrantError, MissingTokenError from werkzeug.exceptions import Forbidden from flask import Flask, json, render_template, request, redirect, url_for, flash, session, g, make_response from markupsafe import Markup @@ -139,7 +139,7 @@ def decorated_function(*args, **kwargs): if oidc_blueprint.session.token['expires_in'] < 20: app.logger.debug("Force refresh token") oidc_blueprint.session.get(settings.oidcUserInfoPath) - except (InvalidTokenError, TokenExpiredError, InvalidGrantError): + except (InvalidTokenError, TokenExpiredError, InvalidGrantError, MissingTokenError): flash("Token expired.", 'warning') return logout(next_url=request.full_path)