mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-30 12:13:52 +08:00 
			
		
		
		
	Merge pull request #1581 from TriliumNext/totp
Fix redirect url with reverse proxy
This commit is contained in:
		
						commit
						a5b481146b
					
				| @ -28,7 +28,7 @@ function checkAuth(req: Request, res: Response, next: NextFunction) { | |||||||
|     } else if (currentTotpStatus !== lastAuthState.totpEnabled || currentSsoStatus !== lastAuthState.ssoEnabled) { |     } else if (currentTotpStatus !== lastAuthState.totpEnabled || currentSsoStatus !== lastAuthState.ssoEnabled) { | ||||||
|         req.session.destroy((err) => { |         req.session.destroy((err) => { | ||||||
|             if (err) console.error('Error destroying session:', err); |             if (err) console.error('Error destroying session:', err); | ||||||
|             res.redirect('/login'); |             res.redirect('login'); | ||||||
|         }); |         }); | ||||||
|         return; |         return; | ||||||
|     } else if (currentSsoStatus) { |     } else if (currentSsoStatus) { | ||||||
| @ -36,7 +36,7 @@ function checkAuth(req: Request, res: Response, next: NextFunction) { | |||||||
|             next(); |             next(); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         res.redirect('/login'); |         res.redirect('login'); | ||||||
|         return; |         return; | ||||||
|     } else if (!req.session.loggedIn && !noAuthentication) { |     } else if (!req.session.loggedIn && !noAuthentication) { | ||||||
|         const redirectToShare = options.getOptionBool("redirectBareDomain"); |         const redirectToShare = options.getOptionBool("redirectBareDomain"); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran