From 16c48de031f015f16af7569c798b46ce64faa3d6 Mon Sep 17 00:00:00 2001 From: x032205 Date: Thu, 19 Jun 2025 19:18:02 -0400 Subject: [PATCH] refreshToken -> RefreshToken --- backend/src/server/routes/v3/login-router.ts | 8 ++++---- cli/packages/api/model.go | 2 +- cli/packages/models/cli.go | 2 +- frontend/src/hooks/api/auth/queries.tsx | 2 +- .../LoginPage/components/PasswordStep/PasswordStep.tsx | 8 ++++---- .../src/pages/auth/SelectOrgPage/SelectOrgSection.tsx | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/backend/src/server/routes/v3/login-router.ts b/backend/src/server/routes/v3/login-router.ts index c7740b665..05337182f 100644 --- a/backend/src/server/routes/v3/login-router.ts +++ b/backend/src/server/routes/v3/login-router.ts @@ -51,7 +51,7 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => { token: z.string(), isMfaEnabled: z.boolean(), mfaMethod: z.string().optional(), - refreshToken: z.string().optional() + RefreshToken: z.string().optional() }) } }, @@ -102,7 +102,7 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => { maxAge: 0 }); - return { token: tokens.access, isMfaEnabled: false, refreshToken: tokens.refresh }; + return { token: tokens.access, isMfaEnabled: false, RefreshToken: tokens.refresh }; } }); @@ -131,7 +131,7 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => { iv: z.string(), tag: z.string(), token: z.string(), - refreshToken: z.string().optional() + RefreshToken: z.string().optional() }) } }, @@ -175,7 +175,7 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => { protectedKey: data.user.protectedKey || null, protectedKeyIV: data.user.protectedKeyIV || null, protectedKeyTag: data.user.protectedKeyTag || null, - refreshToken: data.token.refresh + RefreshToken: data.token.refresh } as const; } }); diff --git a/cli/packages/api/model.go b/cli/packages/api/model.go index 59abe0253..aa8337332 100644 --- a/cli/packages/api/model.go +++ b/cli/packages/api/model.go @@ -267,7 +267,7 @@ type GetLoginTwoV2Response struct { ProtectedKey string `json:"protectedKey"` ProtectedKeyIV string `json:"protectedKeyIV"` ProtectedKeyTag string `json:"protectedKeyTag"` - RefreshToken string `json:"refreshToken"` + RefreshToken string `json:"RefreshToken"` } type VerifyMfaTokenRequest struct { diff --git a/cli/packages/models/cli.go b/cli/packages/models/cli.go index 4785d81f1..f0cc7baa1 100644 --- a/cli/packages/models/cli.go +++ b/cli/packages/models/cli.go @@ -6,7 +6,7 @@ type UserCredentials struct { Email string `json:"email"` PrivateKey string `json:"privateKey"` JWTToken string `json:"JTWToken"` - RefreshToken string `json:"refreshToken"` + RefreshToken string `json:"RefreshToken"` } // The file struct for Infisical config file diff --git a/frontend/src/hooks/api/auth/queries.tsx b/frontend/src/hooks/api/auth/queries.tsx index 9acd2308f..1abb40e89 100644 --- a/frontend/src/hooks/api/auth/queries.tsx +++ b/frontend/src/hooks/api/auth/queries.tsx @@ -73,7 +73,7 @@ export const selectOrganization = async (data: { }) => { const { data: res } = await apiRequest.post<{ token: string; - refreshToken: string; + RefreshToken: string; isMfaEnabled: boolean; mfaMethod?: MfaMethod; }>("/api/v3/auth/select-organization", data); diff --git a/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx b/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx index ee8e334bf..91f84b74b 100644 --- a/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx +++ b/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx @@ -76,7 +76,7 @@ export const PasswordStep = ({ // case: organization ID is present from the provider auth token -- select the org and use the new jwt token in the CLI, then navigate to the org if (organizationId) { const finishWithOrgWorkflow = async () => { - const { token, isMfaEnabled, mfaMethod, refreshToken } = await selectOrganization({ + const { token, isMfaEnabled, mfaMethod, RefreshToken } = await selectOrganization({ organizationId }); @@ -97,7 +97,7 @@ export const PasswordStep = ({ privateKey, email, JTWToken: token, - refreshToken + RefreshToken }; await instance.post(cliUrl, payload).catch(() => { // if error happens to communicate we set the token with an expiry in session storage @@ -190,7 +190,7 @@ export const PasswordStep = ({ // case: organization ID is present from the provider auth token -- select the org and use the new jwt token in the CLI, then navigate to the org if (organizationId) { const finishWithOrgWorkflow = async () => { - const { token, isMfaEnabled, mfaMethod, refreshToken } = await selectOrganization({ + const { token, isMfaEnabled, mfaMethod, RefreshToken } = await selectOrganization({ organizationId }); @@ -210,7 +210,7 @@ export const PasswordStep = ({ const payload = { ...isCliLoginSuccessful.loginResponse, JTWToken: token, - refreshToken + RefreshToken }; await instance.post(cliUrl, payload).catch(() => { // if error happens to communicate we set the token with an expiry in session storage diff --git a/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx b/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx index 014b4b1dd..53e54bc3c 100644 --- a/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx +++ b/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx @@ -112,7 +112,7 @@ export const SelectOrganizationSection = () => { return; } - const { token, isMfaEnabled, mfaMethod, refreshToken } = await selectOrg + const { token, isMfaEnabled, mfaMethod, RefreshToken } = await selectOrg .mutateAsync({ organizationId: organization.id, userAgent: callbackPort ? UserAgentType.CLI : undefined @@ -152,7 +152,7 @@ export const SelectOrganizationSection = () => { JTWToken: token, email: user?.email, privateKey, - refreshToken + RefreshToken } as IsCliLoginSuccessful["loginResponse"]; // send request to server endpoint