Skip to content

Commit 00576f4

Browse files
polish
1 parent 8ea8f66 commit 00576f4

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/vault/components/create-vault-account.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default function CreateVaultAccountButton(props: {
101101
return;
102102
}
103103

104-
const fileContent = `Project: ${props.project.name} (${props.project.publishableKey})\nVault Admin Key: ${initialiseProjectWithVaultMutation.data.serviceAccount.adminKey}\nVault Access Token: ${initialiseProjectWithVaultMutation.data.userAccessToken.accessToken}\n`;
104+
const fileContent = `Project:\n${props.project.name} (${props.project.publishableKey})\n\nVault Admin Key:\n${initialiseProjectWithVaultMutation.data.serviceAccount.adminKey}\n\nVault Access Token:\n${initialiseProjectWithVaultMutation.data.userAccessToken.accessToken}\n`;
105105
const blob = new Blob([fileContent], { type: "text/plain;charset=utf-8" });
106106
const url = URL.createObjectURL(blob);
107107
const link = document.createElement("a");

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/vault/components/list-access-tokens.client.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export default function ListAccessTokens(props: {
173173
setModalOpen(true);
174174
} else {
175175
setAdminKey("");
176+
setTypedAdminKey("");
176177
queryClient.invalidateQueries({
177178
queryKey: ["list-access-tokens"],
178179
});
@@ -192,6 +193,12 @@ export default function ListAccessTokens(props: {
192193
<Skeleton className="h-10 w-full" />
193194
<Skeleton className="h-10 w-full" />
194195
</div>
196+
) : listAccessTokensQuery.error ? (
197+
<div className="flex flex-col gap-4">
198+
<p className="text-destructive-text text-sm">
199+
Failed to list access tokens. Check your admin key and try again.
200+
</p>
201+
</div>
195202
) : listAccessTokensQuery.data ? (
196203
<div>
197204
<div className="space-y-6 pt-0">

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/vault/components/rotate-admin-key.client.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ import { useDashboardRouter } from "@/lib/DashboardRouter";
1717
import { cn } from "@/lib/utils";
1818
import { useMutation } from "@tanstack/react-query";
1919
import { rotateServiceAccount } from "@thirdweb-dev/vault-sdk";
20-
import { CheckIcon, DownloadIcon, Loader2, RefreshCcwIcon } from "lucide-react";
20+
import {
21+
CheckIcon,
22+
CircleAlertIcon,
23+
DownloadIcon,
24+
Loader2,
25+
RefreshCcwIcon,
26+
} from "lucide-react";
2127
import { useState } from "react";
2228
import { toast } from "sonner";
2329
import {
@@ -98,7 +104,7 @@ export default function RotateAdminKeyButton(props: { project: Project }) {
98104
return;
99105
}
100106

101-
const fileContent = `Project: ${props.project.name} (${props.project.publishableKey})\nVault Admin Key: ${rotateAdminKeyMutation.data.adminKey}\nVault Access Token: ${rotateAdminKeyMutation.data.userAccessToken.accessToken}\n`;
107+
const fileContent = `Project:\n${props.project.name} (${props.project.publishableKey})\n\nVault Admin Key:\n${rotateAdminKeyMutation.data.adminKey}\n\nVault Access Token:\n${rotateAdminKeyMutation.data.userAccessToken.accessToken}\n`;
102108
const blob = new Blob([fileContent], { type: "text/plain;charset=utf-8" });
103109
const url = URL.createObjectURL(blob);
104110
const link = document.createElement("a");
@@ -269,10 +275,18 @@ export default function RotateAdminKeyButton(props: { project: Project }) {
269275
</DialogHeader>
270276
<div className="flex flex-col gap-4">
271277
<div className="flex flex-col gap-4 px-6">
272-
<p className="text-destructive">
273-
This will invalidate your current admin key and all existing
274-
access tokens.
278+
<p className="text-md text-primary-foreground">
279+
Revoke your current keys and generates new ones.
275280
</p>
281+
<Alert variant="destructive">
282+
<CircleAlertIcon className="size-5" />
283+
<AlertTitle>Important</AlertTitle>
284+
<AlertDescription>
285+
This action will invalidate your current admin key and all
286+
existing access tokens. You will need to update your
287+
backend to use these new access tokens.
288+
</AlertDescription>
289+
</Alert>
276290
</div>
277291
<div className="flex justify-end gap-3 border-t bg-card px-6 py-4">
278292
<Button

0 commit comments

Comments
 (0)