From 76d37d4bc729524da43748c33f788199dbe8a0b6 Mon Sep 17 00:00:00 2001 From: adrien2p Date: Fri, 27 Jan 2023 13:03:46 +0100 Subject: [PATCH] fix: apply expiresIn from the auth provider config --- packages/medusa-plugin-auth/src/auth-strategies/auth0/admin.ts | 1 + packages/medusa-plugin-auth/src/auth-strategies/auth0/store.ts | 1 + .../medusa-plugin-auth/src/auth-strategies/facebook/admin.ts | 1 + .../medusa-plugin-auth/src/auth-strategies/facebook/store.ts | 1 + .../medusa-plugin-auth/src/auth-strategies/firebase/admin.ts | 1 + .../medusa-plugin-auth/src/auth-strategies/firebase/store.ts | 1 + .../medusa-plugin-auth/src/auth-strategies/google/admin.ts | 1 + .../medusa-plugin-auth/src/auth-strategies/google/store.ts | 3 ++- .../medusa-plugin-auth/src/auth-strategies/linkedin/admin.ts | 1 + .../medusa-plugin-auth/src/auth-strategies/linkedin/store.ts | 1 + 10 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/medusa-plugin-auth/src/auth-strategies/auth0/admin.ts b/packages/medusa-plugin-auth/src/auth-strategies/auth0/admin.ts index 62ac41c..ef8167b 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/auth0/admin.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/auth0/admin.ts @@ -74,5 +74,6 @@ export function getAuth0AdminAuthRouter(auth0: Auth0Options, configModule: Confi passportCallbackAuthenticateMiddlewareOptions: { failureRedirect: auth0.admin.failureRedirect, }, + expiresIn: auth0.admin.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/auth0/store.ts b/packages/medusa-plugin-auth/src/auth-strategies/auth0/store.ts index 9d26482..cd3e450 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/auth0/store.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/auth0/store.ts @@ -74,5 +74,6 @@ export function getAuth0StoreAuthRouter(auth0: Auth0Options, configModule: Confi passportCallbackAuthenticateMiddlewareOptions: { failureRedirect: auth0.store.failureRedirect, }, + expiresIn: auth0.store.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/facebook/admin.ts b/packages/medusa-plugin-auth/src/auth-strategies/facebook/admin.ts index cf5692e..68b9210 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/facebook/admin.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/facebook/admin.ts @@ -59,5 +59,6 @@ export function getFacebookAdminAuthRouter(facebook: FacebookAuthOptions, config passportCallbackAuthenticateMiddlewareOptions: { failureRedirect: facebook.admin.failureRedirect, }, + expiresIn: facebook.admin.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/facebook/store.ts b/packages/medusa-plugin-auth/src/auth-strategies/facebook/store.ts index 7706a53..c20134d 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/facebook/store.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/facebook/store.ts @@ -59,5 +59,6 @@ export function getFacebookStoreAuthRouter(facebook: FacebookAuthOptions, config passportCallbackAuthenticateMiddlewareOptions: { failureRedirect: facebook.store.failureRedirect, }, + expiresIn: facebook.store.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/firebase/admin.ts b/packages/medusa-plugin-auth/src/auth-strategies/firebase/admin.ts index 294845f..aecda75 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/firebase/admin.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/firebase/admin.ts @@ -42,5 +42,6 @@ export function getFirebaseAdminAuthRouter(firebase: FirebaseAuthOptions, config configModule, authPath: firebase.admin.authPath ?? '/admin/auth/firebase', strategyName: FIREBASE_ADMIN_STRATEGY_NAME, + expiresIn: firebase.admin.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/firebase/store.ts b/packages/medusa-plugin-auth/src/auth-strategies/firebase/store.ts index 5a9a040..d972757 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/firebase/store.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/firebase/store.ts @@ -41,5 +41,6 @@ export function getFirebaseStoreAuthRouter(firebase: FirebaseAuthOptions, config configModule, authPath: firebase.store.authPath ?? '/store/auth/firebase', strategyName: FIREBASE_STORE_STRATEGY_NAME, + expiresIn: firebase.store.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/google/admin.ts b/packages/medusa-plugin-auth/src/auth-strategies/google/admin.ts index 80025ba..70695bb 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/google/admin.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/google/admin.ts @@ -62,5 +62,6 @@ export function getGoogleAdminAuthRouter(google: GoogleAuthOptions, configModule passportCallbackAuthenticateMiddlewareOptions: { failureRedirect: google.admin.failureRedirect, }, + expiresIn: google.admin.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/google/store.ts b/packages/medusa-plugin-auth/src/auth-strategies/google/store.ts index 9056c25..bb3337a 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/google/store.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/google/store.ts @@ -59,7 +59,8 @@ export function getGoogleStoreAuthRouter(google: GoogleAuthOptions, configModule ], }, passportCallbackAuthenticateMiddlewareOptions: { - failureRedirect: google.admin.failureRedirect, + failureRedirect: google.store.failureRedirect, }, + expiresIn: google.admin.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/linkedin/admin.ts b/packages/medusa-plugin-auth/src/auth-strategies/linkedin/admin.ts index 219b818..e17740b 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/linkedin/admin.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/linkedin/admin.ts @@ -64,5 +64,6 @@ export function getLinkedinAdminAuthRouter(linkedin: LinkedinAuthOptions, config passportCallbackAuthenticateMiddlewareOptions: { failureRedirect: linkedin.admin.failureRedirect, }, + expiresIn: linkedin.admin.expiresIn, }); } diff --git a/packages/medusa-plugin-auth/src/auth-strategies/linkedin/store.ts b/packages/medusa-plugin-auth/src/auth-strategies/linkedin/store.ts index d8d5396..fb8b5a4 100644 --- a/packages/medusa-plugin-auth/src/auth-strategies/linkedin/store.ts +++ b/packages/medusa-plugin-auth/src/auth-strategies/linkedin/store.ts @@ -63,5 +63,6 @@ export function getLinkedinStoreAuthRouter(linkedin: LinkedinAuthOptions, config passportCallbackAuthenticateMiddlewareOptions: { failureRedirect: linkedin.store.failureRedirect, }, + expiresIn: linkedin.store.expiresIn, }); }