auth: remove refresh-session redirect on expired token — fall through instead
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
858e70f7bb
commit
9114e3376a
|
|
@ -23,17 +23,9 @@ app.use( ( req: Request, res: Response, next: NextFunction ) =>
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
catch ( err )
|
catch ( err )
|
||||||
{
|
|
||||||
if ( err instanceof jwt.TokenExpiredError )
|
|
||||||
{
|
|
||||||
const redirect = encodeURIComponent( req.protocol + '://' + req.get( 'host' ) + req.originalUrl );
|
|
||||||
res.redirect( `/api/auth/refresh-session?redirect=${redirect}` );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
app.use( express.static( path.join( __dirname, '..', '..', 'build', 'app' ) ) );
|
app.use( express.static( path.join( __dirname, '..', '..', 'build', 'app' ) ) );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue