feat: show the instance ID after setup
This commit is contained in:
+17
-2
@@ -39,7 +39,7 @@ export default function SetupPage() {
|
||||
const [password, setPassword] = useState("");
|
||||
const [confirm, setConfirm] = useState("");
|
||||
const [validationError, setValidationError] = useState<string | null>(null);
|
||||
const [created, setCreated] = useState<{ slug: string; loginUrl: string } | null>(null);
|
||||
const [created, setCreated] = useState<{ slug: string; loginUrl: string; instanceId: string } | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
auth.bootstrapStatus()
|
||||
@@ -56,7 +56,7 @@ export default function SetupPage() {
|
||||
} = useMutation({
|
||||
mutationFn: () => auth.bootstrap({ instance_name: instanceName, email, password }),
|
||||
onSuccess: (res) => {
|
||||
setCreated({ slug: res.slug, loginUrl: instanceLoginUrlForSlug(res.slug) });
|
||||
setCreated({ slug: res.slug, loginUrl: instanceLoginUrlForSlug(res.slug), instanceId: res.instance_id });
|
||||
},
|
||||
});
|
||||
|
||||
@@ -93,6 +93,21 @@ export default function SetupPage() {
|
||||
you just chose.
|
||||
</p>
|
||||
<code className="mt-3 block overflow-x-auto rounded bg-surface-2 px-2 py-1.5 font-mono text-xs text-text-primary">{created.loginUrl}</code>
|
||||
|
||||
<div className="mt-4 rounded border border-border p-3">
|
||||
<p className="text-xs text-text-tertiary">Instance ID — needed to activate a licence</p>
|
||||
<div className="mt-1 flex items-center gap-2">
|
||||
<code className="overflow-x-auto font-mono text-xs text-text-primary">{created.instanceId}</code>
|
||||
<button
|
||||
type="button"
|
||||
className="text-xs underline"
|
||||
onClick={() => navigator.clipboard.writeText(created.instanceId)}
|
||||
>
|
||||
Copy
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href={created.loginUrl} className="mt-5 block">
|
||||
<Button type="button" variant="primary" className="w-full justify-center">
|
||||
Go to sign in
|
||||
|
||||
Reference in New Issue
Block a user