Skip to content

Commit 9805ac0

Browse files
committed
docs: update docs for the email password reset plugin
AdminForth/1815/in-email-password-reset-we-can
1 parent 8c21a4b commit 9805ac0

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ plugins: [
6060
// domain part should be verified in SES
6161
sendFrom: 'no-reply@devforth.io',
6262

63+
// origin(s) of your admin panel that reset links are allowed to point to.
64+
// Required: the origin is never taken from the request, so an attacker
65+
// cannot make the plugin email a valid reset link to a host they control.
66+
// Pass an array if the panel is served on multiple origins.
67+
expectedOrigin: 'https://admin.example.com',
68+
6369
adapter: new EmailAdapterAwsSes({
6470
// region where SES is setup
6571
region: "eu-central-1",
@@ -106,6 +112,12 @@ plugins: [
106112
// domain part should be verified in Mailgun
107113
sendFrom: 'no-reply@devforth.io',
108114

115+
// origin(s) of your admin panel that reset links are allowed to point to.
116+
// Required: the origin is never taken from the request, so an attacker
117+
// cannot make the plugin email a valid reset link to a host they control.
118+
// Pass an array if the panel is served on multiple origins.
119+
expectedOrigin: 'https://admin.example.com',
120+
109121
adapter: new EmailAdapterMailgun({
110122
apiKey: process.env.MAILGUN_API_KEY as string,
111123
domain: process.env.MAILGUN_DOMAIN as string,

dev-demo/resources/adminuser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export default {
199199
sendFrom: 'no-reply@devforth.io',
200200
adapter: fakeEmailAdapter,
201201
userResetTokensKeyValueAdapter: new KeyValueAdapterRam(),
202+
expectedOrigin: process.env.RESET_PASSWORD_ORIGIN || 'http://localhost:3123',
202203
}),
203204
],
204205
hooks: {

0 commit comments

Comments
 (0)