refreshToken -> RefreshToken

This commit is contained in:
x032205
2025-06-19 19:18:02 -04:00
parent 9445f717f4
commit 16c48de031
6 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -51,7 +51,7 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
token: z.string(), token: z.string(),
isMfaEnabled: z.boolean(), isMfaEnabled: z.boolean(),
mfaMethod: z.string().optional(), mfaMethod: z.string().optional(),
refreshToken: z.string().optional() RefreshToken: z.string().optional()
}) })
} }
}, },
@@ -102,7 +102,7 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
maxAge: 0 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(), iv: z.string(),
tag: z.string(), tag: z.string(),
token: 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, protectedKey: data.user.protectedKey || null,
protectedKeyIV: data.user.protectedKeyIV || null, protectedKeyIV: data.user.protectedKeyIV || null,
protectedKeyTag: data.user.protectedKeyTag || null, protectedKeyTag: data.user.protectedKeyTag || null,
refreshToken: data.token.refresh RefreshToken: data.token.refresh
} as const; } as const;
} }
}); });
+1 -1
View File
@@ -267,7 +267,7 @@ type GetLoginTwoV2Response struct {
ProtectedKey string `json:"protectedKey"` ProtectedKey string `json:"protectedKey"`
ProtectedKeyIV string `json:"protectedKeyIV"` ProtectedKeyIV string `json:"protectedKeyIV"`
ProtectedKeyTag string `json:"protectedKeyTag"` ProtectedKeyTag string `json:"protectedKeyTag"`
RefreshToken string `json:"refreshToken"` RefreshToken string `json:"RefreshToken"`
} }
type VerifyMfaTokenRequest struct { type VerifyMfaTokenRequest struct {
+1 -1
View File
@@ -6,7 +6,7 @@ type UserCredentials struct {
Email string `json:"email"` Email string `json:"email"`
PrivateKey string `json:"privateKey"` PrivateKey string `json:"privateKey"`
JWTToken string `json:"JTWToken"` JWTToken string `json:"JTWToken"`
RefreshToken string `json:"refreshToken"` RefreshToken string `json:"RefreshToken"`
} }
// The file struct for Infisical config file // The file struct for Infisical config file
+1 -1
View File
@@ -73,7 +73,7 @@ export const selectOrganization = async (data: {
}) => { }) => {
const { data: res } = await apiRequest.post<{ const { data: res } = await apiRequest.post<{
token: string; token: string;
refreshToken: string; RefreshToken: string;
isMfaEnabled: boolean; isMfaEnabled: boolean;
mfaMethod?: MfaMethod; mfaMethod?: MfaMethod;
}>("/api/v3/auth/select-organization", data); }>("/api/v3/auth/select-organization", data);
@@ -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 // 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) { if (organizationId) {
const finishWithOrgWorkflow = async () => { const finishWithOrgWorkflow = async () => {
const { token, isMfaEnabled, mfaMethod, refreshToken } = await selectOrganization({ const { token, isMfaEnabled, mfaMethod, RefreshToken } = await selectOrganization({
organizationId organizationId
}); });
@@ -97,7 +97,7 @@ export const PasswordStep = ({
privateKey, privateKey,
email, email,
JTWToken: token, JTWToken: token,
refreshToken RefreshToken
}; };
await instance.post(cliUrl, payload).catch(() => { await instance.post(cliUrl, payload).catch(() => {
// if error happens to communicate we set the token with an expiry in session storage // 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 // 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) { if (organizationId) {
const finishWithOrgWorkflow = async () => { const finishWithOrgWorkflow = async () => {
const { token, isMfaEnabled, mfaMethod, refreshToken } = await selectOrganization({ const { token, isMfaEnabled, mfaMethod, RefreshToken } = await selectOrganization({
organizationId organizationId
}); });
@@ -210,7 +210,7 @@ export const PasswordStep = ({
const payload = { const payload = {
...isCliLoginSuccessful.loginResponse, ...isCliLoginSuccessful.loginResponse,
JTWToken: token, JTWToken: token,
refreshToken RefreshToken
}; };
await instance.post(cliUrl, payload).catch(() => { await instance.post(cliUrl, payload).catch(() => {
// if error happens to communicate we set the token with an expiry in session storage // if error happens to communicate we set the token with an expiry in session storage
@@ -112,7 +112,7 @@ export const SelectOrganizationSection = () => {
return; return;
} }
const { token, isMfaEnabled, mfaMethod, refreshToken } = await selectOrg const { token, isMfaEnabled, mfaMethod, RefreshToken } = await selectOrg
.mutateAsync({ .mutateAsync({
organizationId: organization.id, organizationId: organization.id,
userAgent: callbackPort ? UserAgentType.CLI : undefined userAgent: callbackPort ? UserAgentType.CLI : undefined
@@ -152,7 +152,7 @@ export const SelectOrganizationSection = () => {
JTWToken: token, JTWToken: token,
email: user?.email, email: user?.email,
privateKey, privateKey,
refreshToken RefreshToken
} as IsCliLoginSuccessful["loginResponse"]; } as IsCliLoginSuccessful["loginResponse"];
// send request to server endpoint // send request to server endpoint