feat: Add installationId to arguments for verifyUserEmails, preventLoginWithUnverifiedEmail (#8836)
This commit is contained in:
@@ -299,7 +299,7 @@ describe('Email Verification Token Expiration: ', () => {
|
|||||||
};
|
};
|
||||||
const verifyUserEmails = {
|
const verifyUserEmails = {
|
||||||
method(req) {
|
method(req) {
|
||||||
expect(Object.keys(req)).toEqual(['original', 'object', 'master', 'ip']);
|
expect(Object.keys(req)).toEqual(['original', 'object', 'master', 'ip', 'installationId']);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -358,7 +358,7 @@ describe('Email Verification Token Expiration: ', () => {
|
|||||||
};
|
};
|
||||||
const verifyUserEmails = {
|
const verifyUserEmails = {
|
||||||
method(req) {
|
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') {
|
if (req.object.get('username') === 'no_email') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -804,6 +804,7 @@ RestWrite.prototype._validateEmail = function () {
|
|||||||
object: updatedObject,
|
object: updatedObject,
|
||||||
master: this.auth.isMaster,
|
master: this.auth.isMaster,
|
||||||
ip: this.config.ip,
|
ip: this.config.ip,
|
||||||
|
installationId: this.auth.installationId,
|
||||||
};
|
};
|
||||||
return this.config.userController.setEmailVerifyToken(this.data, request, this.storage);
|
return this.config.userController.setEmailVerifyToken(this.data, request, this.storage);
|
||||||
}
|
}
|
||||||
@@ -947,6 +948,7 @@ RestWrite.prototype.createSessionTokenIfNeeded = async function () {
|
|||||||
object: updatedObject,
|
object: updatedObject,
|
||||||
master: this.auth.isMaster,
|
master: this.auth.isMaster,
|
||||||
ip: this.config.ip,
|
ip: this.config.ip,
|
||||||
|
installationId: this.auth.installationId,
|
||||||
};
|
};
|
||||||
shouldPreventUnverifedLogin = await Promise.resolve(
|
shouldPreventUnverifedLogin = await Promise.resolve(
|
||||||
this.config.preventLoginWithUnverifiedEmail(request)
|
this.config.preventLoginWithUnverifiedEmail(request)
|
||||||
|
|||||||
Reference in New Issue
Block a user