Set access-granted for global admin.

This commit is contained in:
Hendrik Belitz
2025-10-07 18:32:13 +02:00
parent 4572352341
commit bdc157bda6
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -28,6 +28,11 @@ const userCreationSchema = z.object({
token: z.uuidv7().optional(),
tokenValidUntil: z.date().optional(),
language: z.enum(["de", "en"]).optional().default("de"),
confirmationState: z
.enum(["INVITED", "CONFIRMED", "ACCESS_GRANTED"])
.optional()
.default("INVITED"),
// Note: passphraseHash and recoveryPassphrase are handled internally, not via user input
});
type UserCreation = z.infer<typeof userCreationSchema>;
+1
View File
@@ -150,6 +150,7 @@ export const POST: RequestHandler = async ({ request, cookies, url }) => {
passphrase: body.passphrase, // Will be undefined if passkey is used
language: body.language || "de",
role: "GLOBAL_ADMIN",
confirmationState: "ACCESS_GRANTED", // Admin account is active immediately
},
url,
);