mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
Fixed service token bug
This commit is contained in:
@@ -37,6 +37,7 @@ export const useCreateServiceToken = () => {
|
|||||||
return useMutation<CreateServiceTokenRes, {}, CreateServiceTokenDTO>({
|
return useMutation<CreateServiceTokenRes, {}, CreateServiceTokenDTO>({
|
||||||
mutationFn: async (body) => {
|
mutationFn: async (body) => {
|
||||||
const { data } = await apiRequest.post('/api/v2/service-token/', body);
|
const { data } = await apiRequest.post('/api/v2/service-token/', body);
|
||||||
|
data.serviceToken += `.${ body.randomBytes}`;
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
onSuccess: ({ serviceTokenData: { workspace } }) => {
|
onSuccess: ({ serviceTokenData: { workspace } }) => {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export type CreateServiceTokenDTO = {
|
|||||||
encryptedKey: string;
|
encryptedKey: string;
|
||||||
iv: string;
|
iv: string;
|
||||||
tag: string;
|
tag: string;
|
||||||
|
randomBytes: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CreateServiceTokenRes = {
|
export type CreateServiceTokenRes = {
|
||||||
|
|||||||
@@ -31,11 +31,8 @@ import {
|
|||||||
useUpdateWsEnvironment
|
useUpdateWsEnvironment
|
||||||
} from '@app/hooks/api';
|
} from '@app/hooks/api';
|
||||||
|
|
||||||
|
|
||||||
import { AutoCapitalizationSection } from './components/AutoCapitalizationSection/AutoCapitalizationSection';
|
import { AutoCapitalizationSection } from './components/AutoCapitalizationSection/AutoCapitalizationSection';
|
||||||
|
|
||||||
import { SecretTagsSection } from './components/SecretTagsSection';
|
import { SecretTagsSection } from './components/SecretTagsSection';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CopyProjectIDSection,
|
CopyProjectIDSection,
|
||||||
CreateServiceToken,
|
CreateServiceToken,
|
||||||
@@ -226,7 +223,8 @@ export const ProjectSettingsPage = () => {
|
|||||||
environment,
|
environment,
|
||||||
expiresIn: Number(expiresIn),
|
expiresIn: Number(expiresIn),
|
||||||
name,
|
name,
|
||||||
workspaceId: workspaceID
|
workspaceId: workspaceID,
|
||||||
|
randomBytes
|
||||||
});
|
});
|
||||||
console.log(res);
|
console.log(res);
|
||||||
createNotification({
|
createNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user