mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-15 00:15:04 +02:00
successful log in loop poc
This commit is contained in:
parent
7556a59e11
commit
53be2739bb
37 changed files with 789 additions and 474 deletions
|
@ -8,6 +8,7 @@ import { eq } from "drizzle-orm";
|
|||
import moment from "moment";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { passwordSchema } from "@server/auth/passwordSchema";
|
||||
import { UserType } from "@server/types/UserTypes";
|
||||
|
||||
export async function setupServerAdmin() {
|
||||
const {
|
||||
|
@ -34,7 +35,7 @@ export async function setupServerAdmin() {
|
|||
if (existing) {
|
||||
const passwordChanged = !(await verifyPassword(
|
||||
password,
|
||||
existing.passwordHash
|
||||
existing.passwordHash!
|
||||
));
|
||||
|
||||
if (passwordChanged) {
|
||||
|
@ -65,6 +66,8 @@ export async function setupServerAdmin() {
|
|||
await db.insert(users).values({
|
||||
userId: userId,
|
||||
email: email,
|
||||
type: UserType.Internal,
|
||||
username: email,
|
||||
passwordHash,
|
||||
dateCreated: moment().toISOString(),
|
||||
serverAdmin: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue