MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / getOrCreateAuthWithEmail

Method getOrCreateAuthWithEmail

apps/web/services/users/users.ts:90–105  ·  view source on GitHub ↗
(email: string)

Source from the content-addressed store, hash-verified

88 return null;
89 }
90 static async getOrCreateAuthWithEmail(email: string) {
91 const auth = await prisma.auths.findUnique({ where: { email } });
92 if (auth) return auth;
93
94 const newAuth = await prisma.auths.create({
95 data: {
96 email,
97 password: v4(),
98 salt: v4(),
99 emailVerified: new Date(),
100 },
101 });
102
103 await eventSignUp(newAuth.id, email, newAuth.createdAt);
104 return newAuth;
105 }
106 static async createAuth({ email, password }: CreateAuthParams) {
107 const salt = generateSalt();
108 const hash = generateHash(password, salt);

Callers

nothing calls this directly

Calls 2

eventSignUpFunction · 0.90
createMethod · 0.45

Tested by

no test coverage detected