Skip to content

Commit

Permalink
Fixed service token bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vmatsiiako committed Feb 9, 2023
1 parent dd7e8d2 commit 6ab6147
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions frontend/src/hooks/api/serviceTokens/queries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const useCreateServiceToken = () => {
return useMutation<CreateServiceTokenRes, {}, CreateServiceTokenDTO>({
mutationFn: async (body) => {
const { data } = await apiRequest.post('/api/v2/service-token/', body);
data.serviceToken += `.${ body.randomBytes}`;
return data;
},
onSuccess: ({ serviceTokenData: { workspace } }) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/hooks/api/serviceTokens/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type CreateServiceTokenDTO = {
encryptedKey: string;
iv: string;
tag: string;
randomBytes: string;
};

export type CreateServiceTokenRes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ import {
useUpdateWsEnvironment
} from '@app/hooks/api';


import { AutoCapitalizationSection } from './components/AutoCapitalizationSection/AutoCapitalizationSection';

import { SecretTagsSection } from './components/SecretTagsSection';

import {
CopyProjectIDSection,
CreateServiceToken,
Expand Down Expand Up @@ -226,7 +223,8 @@ export const ProjectSettingsPage = () => {
environment,
expiresIn: Number(expiresIn),
name,
workspaceId: workspaceID
workspaceId: workspaceID,
randomBytes
});
console.log(res);
createNotification({
Expand Down

0 comments on commit 6ab6147

Please sign in to comment.