feat: add better auth sqlite runtime and server-side session flow

This commit is contained in:
Poyraz
2026-07-10 22:07:37 +03:00
parent 3504a02229
commit 57aab2932e
41 changed files with 4907 additions and 143 deletions
+24
View File
@@ -0,0 +1,24 @@
import { z } from "zod";
export const authCredentialsSchema = z.object({
email: z.email().transform((value) => normalizeAuthEmail(value)),
password: z.string().min(8).max(128),
});
export type AuthCredentials = z.infer<typeof authCredentialsSchema>;
export function parseAuthCredentials(formData: FormData): AuthCredentials {
return authCredentialsSchema.parse({
email: formData.get("email"),
password: formData.get("password"),
});
}
export function normalizeAuthEmail(value: string): string {
return value.trim().toLowerCase();
}
export function getDefaultDisplayName(email: string): string {
return email.split("@")[0] || "Neta Kullanıcısı";
}