-
-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add password validation for user with unverified email via `Par…
…se.User.verifyPassword` using master key and option `ignoreEmailVerification: true` (#2076)
- Loading branch information
Showing
7 changed files
with
118 additions
and
228 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ const Parse = require('../../node'); | |
const fs = require('fs'); | ||
const path = require('path'); | ||
const dns = require('dns'); | ||
const MockEmailAdapterWithOptions = require('./support/MockEmailAdapterWithOptions'); | ||
|
||
// Ensure localhost resolves to ipv4 address first on node v17+ | ||
if (dns.setDefaultResultOrder) { | ||
|
@@ -83,6 +84,11 @@ const defaultConfiguration = { | |
revokeSessionOnPasswordReset: false, | ||
allowCustomObjectId: false, | ||
allowClientClassCreation: true, | ||
emailAdapter: MockEmailAdapterWithOptions({ | ||
fromAddress: '[email protected]', | ||
apiKey: 'k', | ||
domain: 'd', | ||
}), | ||
}; | ||
|
||
const openConnections = {}; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = options => { | ||
if (!options) { | ||
throw 'Options were not provided'; | ||
} | ||
const adapter = { | ||
sendVerificationEmail: () => Promise.resolve(), | ||
sendPasswordResetEmail: () => Promise.resolve(), | ||
sendMail: () => Promise.resolve(), | ||
}; | ||
if (options.sendMail) { | ||
adapter.sendMail = options.sendMail; | ||
} | ||
if (options.sendPasswordResetEmail) { | ||
adapter.sendPasswordResetEmail = options.sendPasswordResetEmail; | ||
} | ||
if (options.sendVerificationEmail) { | ||
adapter.sendVerificationEmail = options.sendVerificationEmail; | ||
} | ||
|
||
return adapter; | ||
}; |
Oops, something went wrong.