Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

only set JID token for non-saml SSO

x03220566a68b8237ed
diff --git a/backend/src/server/routes/v1/sso-router.ts b/backend/src/server/routes/v1/sso-router.ts
index 32b09b3371..63f673d3f3 100644
--- a/backend/src/server/routes/v1/sso-router.ts
+++ b/backend/src/server/routes/v1/sso-router.ts
@@ -550,12 +550,14 @@ export const registerSsoRouter = async (server: FastifyZodProvider) => {
providerAuthToken: req.body.providerAuthToken
});
- void res.setCookie("jid", data.token.refresh, {
- httpOnly: true,
- path: "/",
- sameSite: "strict",
- secure: appCfg.HTTPS_ENABLED
- });
+ if ([AuthMethod.GOOGLE, AuthMethod.GITHUB, AuthMethod.GITLAB].includes(data.decodedProviderToken.authMethod)) {
+ void res.setCookie("jid", data.token.refresh, {
+ httpOnly: true,
+ path: "/",
+ sameSite: "strict",
+ secure: appCfg.HTTPS_ENABLED
+ });
+ }
addAuthOriginDomainCookie(res);