change name and tpye of query sendResetPasswordEmail to mutation forgotPassword. Do not throw when email is not found

This commit is contained in:
Moriz Wahl 2022-03-30 18:24:44 +02:00
parent d4415ee256
commit 3078315286

View File

@ -391,10 +391,11 @@ export class UserResolver {
}
@Authorized([RIGHTS.SEND_RESET_PASSWORD_EMAIL])
@Query(() => Boolean)
async sendResetPasswordEmail(@Arg('email') email: string): Promise<boolean> {
@Mutation(() => Boolean)
async forgotPassword(@Arg('email') email: string): Promise<boolean> {
email = email.trim().toLowerCase()
const user = await DbUser.findOneOrFail({ email })
const user = await DbUser.findOne({ email })
if (!user) return true
// can be both types: REGISTER and RESET_PASSWORD
let optInCode = await LoginEmailOptIn.findOne({