Skip to content

Commit

Permalink
Add user to default group on signup, if no token
Browse files Browse the repository at this point in the history
  • Loading branch information
albinmedoc committed Dec 1, 2024
1 parent 0b917a9 commit de7968e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routes/signup/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -79,6 +81,8 @@ export const actions: Actions = {
}
})
)?.id;
} else if (config.defaultGroup) {
groupId = config.defaultGroup;
}

try {
Expand Down

0 comments on commit de7968e

Please sign in to comment.