You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _includes/parse-server/compatibility.md
+75-1Lines changed: 75 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -181,4 +181,78 @@ Facebook, Twitter, and Anonymous logins are supported out of the box. Support fo
181
181
182
182
## Welcome Emails and Email Verification
183
183
184
-
This is not supported out of the box. But, you can use a `beforeSave` to send out emails using a provider like Mailgun and add logic for verification. [Subscribe to this issue](https://github.com/parse-community/parse-server/issues/275) to be notified if email verification support is added to Parse Server.
184
+
Verifying user email addresses and enabling password reset via email requires an email adapter. As part of the `parse-server` package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
185
+
186
+
```js
187
+
var server =ParseServer({
188
+
...otherOptions,
189
+
// Enable email verification
190
+
verifyUserEmails:true,
191
+
192
+
// if `verifyUserEmails` is `true` and
193
+
// if `emailVerifyTokenValidityDuration` is `undefined` then
194
+
// email verify token never expires
195
+
// else
196
+
// email verify token expires after `emailVerifyTokenValidityDuration`
197
+
//
198
+
// `emailVerifyTokenValidityDuration` defaults to `undefined`
// account lockout policy setting (OPTIONAL) - defaults to undefined
227
+
// if the account lockout policy is set and there are more than `threshold` number of failed login attempts then the `login` api call returns error code `Parse.Error.OBJECT_NOT_FOUND` with error message `Your account is locked due to multiple failed login attempts. Please try again after <duration> minute(s)`. After `duration` minutes of no login attempts, the application will allow the user to try login again.
228
+
accountLockout: {
229
+
duration:5, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
230
+
threshold:3, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000.
231
+
},
232
+
// optional settings to enforce password policies
233
+
passwordPolicy: {
234
+
// Two optional settings to enforce strong passwords. Either one or both can be specified.
235
+
// If both are specified, both checks must pass to accept the password
236
+
// 1. a RegExp object or a regex string representing the pattern to enforce
237
+
validatorPattern:/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/, // enforce password with at least 8 char with at least 1 lower case, 1 upper case and 1 digit
238
+
// 2. a callback function to be invoked to validate the password
doNotAllowUsername:true, // optional setting to disallow username in passwords
241
+
maxPasswordAge:90, // optional setting in days for password expiry. Login fails if user does not reset the password within this period after signup/last reset.
242
+
maxPasswordHistory:5, // optional setting to prevent reuse of previous n passwords. Maximum value that can be specified is 20. Not specifying it or specifying 0 will not enforce history.
243
+
//optional setting to set a validity duration for password reset links (in seconds)
244
+
resetTokenValidityDuration:24*60*60, // expire after 24 hours
245
+
}
246
+
});
247
+
```
248
+
249
+
You can also use other email adapters contributed by the community such as:
0 commit comments