Skip to content

Commit

Permalink
fix: use desc instead
Browse files Browse the repository at this point in the history
  • Loading branch information
dyersituations committed May 21, 2024
1 parent 05576eb commit 5573ca6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/auth-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ module.exports = function authRouter(config = {}) {

// Handle errors
if (req.query.error && !silentAuth) {
// Re-attempt login with the login form forced to display if unauthorized/access_denied error happened
if (req.query.error === 'unauthorized' || req.query.error === 'access_denied') {
// Re-attempt login with the login form forced to display if unauthorized error happened
if (req.query.error === 'unauthorized'
|| req.query.error_description?.toLowerCase() === 'session too old, login required'
) {
req.query = {}; // Remove query params from previous auth attempt
return passport.authenticate('auth0', {
audience: config.auth0.apiAudience,
Expand Down

0 comments on commit 5573ca6

Please sign in to comment.