Merge pull request #1581 from TriliumNext/totp

Fix redirect url with reverse proxy
This commit is contained in:
Elian Doran 2025-03-31 22:38:35 +03:00 committed by GitHub
commit a5b481146b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,7 @@ function checkAuth(req: Request, res: Response, next: NextFunction) {
} else if (currentTotpStatus !== lastAuthState.totpEnabled || currentSsoStatus !== lastAuthState.ssoEnabled) {
req.session.destroy((err) => {
if (err) console.error('Error destroying session:', err);
res.redirect('/login');
res.redirect('login');
});
return;
} else if (currentSsoStatus) {
@ -36,7 +36,7 @@ function checkAuth(req: Request, res: Response, next: NextFunction) {
next();
return;
}
res.redirect('/login');
res.redirect('login');
return;
} else if (!req.session.loggedIn && !noAuthentication) {
const redirectToShare = options.getOptionBool("redirectBareDomain");