From 681326865497487a6ad9c45fc48a590fff3db908 Mon Sep 17 00:00:00 2001 From: prostgles Date: Mon, 25 Nov 2024 18:23:07 +0200 Subject: [PATCH] fix auth session --- lib/Auth/setAuthProviders.ts | 7 +++++-- package-lock.json | 4 ++-- package.json | 2 +- tests/server/package-lock.json | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Auth/setAuthProviders.ts b/lib/Auth/setAuthProviders.ts index e53e515f..b6f73e63 100644 --- a/lib/Auth/setAuthProviders.ts +++ b/lib/Auth/setAuthProviders.ts @@ -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) => { diff --git a/package-lock.json b/package-lock.json index c251f64f..43326c5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prostgles-server", - "version": "4.2.145", + "version": "4.2.146", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prostgles-server", - "version": "4.2.145", + "version": "4.2.146", "license": "MIT", "dependencies": { "body-parser": "^1.20.3", diff --git a/package.json b/package.json index 287ad5bb..d22b8126 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/tests/server/package-lock.json b/tests/server/package-lock.json index 0260b1ee..3ab21549 100644 --- a/tests/server/package-lock.json +++ b/tests/server/package-lock.json @@ -21,7 +21,7 @@ }, "../..": { "name": "prostgles-server", - "version": "4.2.145", + "version": "4.2.146", "license": "MIT", "dependencies": { "body-parser": "^1.20.3",