refactor: remove username from User model, login by email only

This commit is contained in:
2026-06-16 16:18:42 +02:00
parent caf19575c6
commit 68c2983d36
30 changed files with 42 additions and 198 deletions
-4
View File
@@ -3,7 +3,6 @@ import { getPasswordHash } from "@/lib/security"
import prisma from "../src/lib/prisma"
type BootstrapAdminInput = {
username: string
email: string
name: string
password: string
@@ -12,7 +11,6 @@ type BootstrapAdminInput = {
function getBootstrapAdminInput(): BootstrapAdminInput {
const isProduction = process.env.NODE_ENV === "production"
const username = process.env.ADMIN_USERNAME ?? "admin"
const email = process.env.ADMIN_EMAIL ?? "admin@localhost"
const name = process.env.ADMIN_NAME ?? "Administrator"
const password = process.env.ADMIN_PASSWORD
@@ -22,7 +20,6 @@ function getBootstrapAdminInput(): BootstrapAdminInput {
}
return {
username,
email,
name,
password: password ?? "admin",
@@ -55,7 +52,6 @@ export async function bootstrapAdmin(client: typeof prisma) {
},
create: {
name: admin.name,
username: admin.username,
email: admin.email,
role: "ADMIN",
password: await getPasswordHash(admin.password),