Skip to content

Commit

Permalink
feat: Add installationId to arguments for verifyUserEmails, `prev…
Browse files Browse the repository at this point in the history
…entLoginWithUnverifiedEmail` (#8836)
  • Loading branch information
mtrezza committed Dec 17, 2023
1 parent 2c2563e commit a22dbe1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/EmailVerificationToken.spec.js
Expand Up @@ -299,7 +299,7 @@ describe('Email Verification Token Expiration: ', () => {
};
const verifyUserEmails = {
method(req) {
expect(Object.keys(req)).toEqual(['original', 'object', 'master', 'ip']);
expect(Object.keys(req)).toEqual(['original', 'object', 'master', 'ip', 'installationId']);
return false;
},
};
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('Email Verification Token Expiration: ', () => {
};
const verifyUserEmails = {
method(req) {
expect(Object.keys(req)).toEqual(['original', 'object', 'master', 'ip']);
expect(Object.keys(req)).toEqual(['original', 'object', 'master', 'ip', 'installationId']);
if (req.object.get('username') === 'no_email') {
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/RestWrite.js
Expand Up @@ -804,6 +804,7 @@ RestWrite.prototype._validateEmail = function () {
object: updatedObject,
master: this.auth.isMaster,
ip: this.config.ip,
installationId: this.auth.installationId,
};
return this.config.userController.setEmailVerifyToken(this.data, request, this.storage);
}
Expand Down Expand Up @@ -947,6 +948,7 @@ RestWrite.prototype.createSessionTokenIfNeeded = async function () {
object: updatedObject,
master: this.auth.isMaster,
ip: this.config.ip,
installationId: this.auth.installationId,
};
shouldPreventUnverifedLogin = await Promise.resolve(
this.config.preventLoginWithUnverifiedEmail(request)
Expand Down

0 comments on commit a22dbe1

Please sign in to comment.