mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 10:46:38 +00:00
Add stepper
This commit is contained in:
@@ -3,7 +3,7 @@ import db from "@server/db";
|
||||
import { hash } from "@node-rs/argon2";
|
||||
import HttpCode from "@server/types/HttpCode";
|
||||
import { z } from "zod";
|
||||
import { users } from "@server/db/schema";
|
||||
import { userActions, users } from "@server/db/schema";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import createHttpError from "http-errors";
|
||||
import response from "@server/utils/response";
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
generateSessionToken,
|
||||
serializeSessionCookie,
|
||||
} from "@server/auth";
|
||||
import { ActionsEnum } from "@server/auth/actions";
|
||||
|
||||
export const signupBodySchema = z.object({
|
||||
email: z.string().email(),
|
||||
@@ -100,6 +101,13 @@ export async function signup(
|
||||
dateCreated: moment().toISOString(),
|
||||
});
|
||||
|
||||
// give the user their default permissions:
|
||||
// await db.insert(userActions).values({
|
||||
// userId: userId,
|
||||
// actionId: ActionsEnum.createOrg,
|
||||
// orgId: null,
|
||||
// });
|
||||
|
||||
const token = generateSessionToken();
|
||||
await createSession(token, userId);
|
||||
const cookie = serializeSessionCookie(token);
|
||||
|
||||
Reference in New Issue
Block a user