Skip to content

Commit

Permalink
fix auth session
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Nov 25, 2024
1 parent 0e4353e commit 6813268
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions lib/Auth/setAuthProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,14 @@ export function setAuthProviders (this: AuthHandler, { registrations, app }: Req
);

app.get(callbackPath,
passport.authenticate(providerName, { session: false, failureRedirect: "/login" }),
passport.authenticate(providerName, {
session: false,
failureRedirect: "/login",
failWithError: true,
}, console.log),
async (req, res) => {
this.loginThrottledAndSetCookie(req, res, { type: "provider", provider: providerName, ...req.authInfo as any })
.then(() => {
// Successful authentication, redirect to main page
res.redirect("/");
})
.catch((e: any) => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prostgles-server",
"version": "4.2.145",
"version": "4.2.146",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6813268

Please sign in to comment.