Skip to content

Commit

Permalink
Update WebLoginAuth.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama authored Jan 7, 2025
1 parent 00aff06 commit 06fc88b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/WebLoginAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class WebLoginAuth {
req.query.RelayState = relayStateObj;
req.query.RelayState = encodeURIComponent(JSON.stringify(relayStateObj));

next();
await next();
};

// Passport initialize must be used prior to other passport middlewares
Expand Down Expand Up @@ -177,7 +177,7 @@ export class WebLoginAuth {
}),
]);

next();
await next();
};

/**
Expand Down Expand Up @@ -231,11 +231,11 @@ export class WebLoginAuth {
try {
const user = await this.validateSessionCookie(req);
req.user = user;
next();
await next();
} catch (error) {
// Allow unauthorized requests through
if (options.allowUnauthorized) {
next();
await next();
} else {
// Check for unauthorized redirect
const redirectUrl = options.redirectUrl || this.config.session.unauthorizedRedirectUrl;
Expand Down

0 comments on commit 06fc88b

Please sign in to comment.