Skip to content

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

feat: modified backend token endpoint to return organizationid

=64fd15c32d8c
diff --git a/backend/src/server/routes/v1/auth-router.ts b/backend/src/server/routes/v1/auth-router.ts
index 6e39d0451d..46f856105f 100644
--- a/backend/src/server/routes/v1/auth-router.ts
+++ b/backend/src/server/routes/v1/auth-router.ts
@@ -63,7 +63,8 @@ export const registerAuthRoutes = async (server: FastifyZodProvider) => {
schema: {
response: {
200: z.object({
- token: z.string()
+ token: z.string(),
+ organizationId: z.string().optional()
})
}
},
@@ -115,7 +116,7 @@ export const registerAuthRoutes = async (server: FastifyZodProvider) => {
{ expiresIn: appCfg.JWT_AUTH_LIFETIME }
);
- return { token };
+ return { token, organizationId: decodedToken.organizationId };
}
});
};