(email: string, password: string)
| 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; |
nothing calls this directly
no test coverage detected