Created
March 11, 2021 18:25
-
-
Save rasikag/c6024f34e6fca2ad35da5ec790eb41db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Mutation(() => Boolean) | |
async forgotPassword( | |
@Arg("email") email: string, | |
@Ctx() { em }: RedditDbContext | |
) { | |
const user = await em.findOne(User, {email}); | |
if (!user) { | |
return true; | |
} | |
const token = "asdasdsadassadsadsadsadsad"; | |
await sendEmail(email, | |
'<a href="http://localhost:3001/reset-password/${token}">click here to reset password</a>'); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment