Skip to content

Commit

Permalink
Merge pull request #563 from grycap/devel
Browse files Browse the repository at this point in the history
Fix error with no renew token
  • Loading branch information
micafer authored Jul 19, 2024
2 parents 874062e + 33ebb1f commit 87fb6de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 87fb6de

Please sign in to comment.