fix auth registration and access management ui

This commit is contained in:
lix-2026
2026-05-22 01:47:40 +08:00
parent fdb20300e9
commit 531e845600
16 changed files with 1316 additions and 410 deletions
+19
View File
@@ -0,0 +1,19 @@
import { Password } from "@convex-dev/auth/providers/Password";
import { convexAuth } from "@convex-dev/auth/server";
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
providers: [
Password({
validatePasswordRequirements: (password: string) => {
if (password.length < 8) {
throw new Error("密码至少需要 8 个字符");
}
},
profile(params) {
const email = typeof params.email === "string" ? params.email : String(params.email ?? "");
const name = typeof params.name === "string" ? params.name.trim() : "";
return { email, name };
},
}),
],
});