mirror of
https://github.com/freedbygrace/ActiveDirectoryManager.git
synced 2026-08-07 09:33:25 +00:00
Fix authentication error causing 500 error by adding check for isAuthenticated function existence.
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/f23c0b09-ba7a-43a9-b8cd-a87451662495.jpg
This commit is contained in:
@@ -17,7 +17,7 @@ export type RequirePermissionOptions = RequireAuthOptions & {
|
||||
export function requireAuth(options: RequireAuthOptions = {}) {
|
||||
return async (req: Request, res: Response, next: NextFunction) => {
|
||||
// Check for session authentication
|
||||
if (req.isAuthenticated()) {
|
||||
if (typeof req.isAuthenticated === 'function' && req.isAuthenticated()) {
|
||||
return next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user