MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / authorize

Method authorize

apps/web/services/users/users.ts:74–89  ·  view source on GitHub ↗
(email: string, password: string)

Source from the content-addressed store, hash-verified

72 });
73 }
74 static async authorize(email: string, password: string) {
75 if (!email || !password) {
76 return null;
77 }
78 const auth = await prisma.auths.findUnique({ where: { email } });
79 if (!auth) {
80 return null;
81 }
82 if (secureCompare(auth.password, generateHash(password, auth.salt))) {
83 return {
84 email: auth.email,
85 id: auth.id,
86 };
87 }
88 return null;
89 }
90 static async getOrCreateAuthWithEmail(email: string) {
91 const auth = await prisma.auths.findUnique({ where: { email } });
92 if (auth) return auth;

Callers

nothing calls this directly

Calls 2

secureCompareFunction · 0.90
generateHashFunction · 0.90

Tested by

no test coverage detected