feat: show the instance ID after setup

This commit is contained in:
2026-07-24 15:20:00 +01:00
parent 8d88b16f20
commit ee4dff09c9
3 changed files with 23 additions and 3 deletions
+5 -1
View File
@@ -126,7 +126,11 @@ func HandleBootstrap(c *gin.Context) {
return
}
SetSessionCookie(c, sessionID)
c.JSON(http.StatusCreated, gin.H{"instance": inst, "slug": inst.Slug})
c.JSON(http.StatusCreated, gin.H{
"instance": inst,
"slug": inst.Slug,
"instance_id": inst.InstanceID,
})
}
func HandleMe(c *gin.Context) {
+17 -2
View File
@@ -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
+1
View File
@@ -327,6 +327,7 @@ export interface BootstrapStatus {
export interface BootstrapResponse {
instance: Instance;
slug: string;
instance_id: string;
}
export interface InstanceUser {