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