From de7968ed787f5f4b72cfe87a75120526d253910c Mon Sep 17 00:00:00 2001 From: Albin Medoc Date: Fri, 29 Nov 2024 12:50:45 +0100 Subject: [PATCH] Add user to default group on signup, if no token --- src/routes/signup/+page.server.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/signup/+page.server.ts b/src/routes/signup/+page.server.ts index 8f6aa1f..ff65b99 100644 --- a/src/routes/signup/+page.server.ts +++ b/src/routes/signup/+page.server.ts @@ -43,6 +43,8 @@ export const load: PageServerLoad = async ({ locals, request }) => { export const actions: Actions = { default: async ({ request, cookies }) => { + + const config = await getConfig(); const formData = Object.fromEntries(await request.formData()); const signupSchema = await getSignupSchema(); const signupData = signupSchema.safeParse(formData); @@ -79,6 +81,8 @@ export const actions: Actions = { } }) )?.id; + } else if (config.defaultGroup) { + groupId = config.defaultGroup; } try {