Skip to content

Commit

Permalink
🐛 Make sure email is parsed to lower case on password reset (#61)
Browse files Browse the repository at this point in the history
Contributed by @mahnuh
  • Loading branch information
mahnuh committed Oct 11, 2022
1 parent fb74522 commit 0fdf5c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,8 @@ export class User {
* @param req additional request data, passed to the template as `req`
*/
public async forgotPassword(email: string, req: any): Promise<void> {
email = email.toLowerCase();

if (!email || !email.match(EMAIL_REGEXP)) {
return Promise.reject({ error: 'invalid email', status: 400 });
}
Expand Down

0 comments on commit 0fdf5c8

Please sign in to comment.