Skip to content

Commit e9f3dcd

Browse files
committed
docs: document password reset email normalization
1 parent 9a730bb commit e9f3dcd

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

adminforth/documentation/docs/tutorial/09-Plugins/07-email-password-reset.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ Plugin allows to reset password for admin users who forgot their password by sen
1313
1414
> ⚠️ If user with email does not exist, plugin will still show to user success message to prevent email enumeration.
1515
16+
## Email normalization
17+
18+
The plugin applies the column's [`normalize`](/docs/tutorial/Customization/standardPagesTuning/#normalize-values-before-saving) callback before validating and looking up the submitted email. It uses the normalized value in the reset token, for token confirmation, and as the email delivery address.
19+
20+
For example, configure the email column to make password reset and login insensitive to surrounding whitespace and letter case:
21+
22+
```typescript title="./resources/adminuser.ts"
23+
{
24+
name: 'email',
25+
required: true,
26+
isUnique: true,
27+
normalize: (value: string) => value.trim().toLowerCase(),
28+
}
29+
```
30+
1631
Installation:
1732

1833
```bash
@@ -148,4 +163,4 @@ If you want create custom header, or want to add some data under input, you can
148163
}
149164
...
150165
})
151-
```
166+
```

0 commit comments

Comments
 (0)