We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 383a897 commit 338519bCopy full SHA for 338519b
middleware/client.js
@@ -232,7 +232,9 @@ exports.checkPhonenumberAuth = (errorCallback) => {
232
* Check if 2FA is required and for what roles
233
*/
234
exports.check2FA = (req, res, next) => {
235
- const twoFactorRoles = req.client.twoFactorRoles;
+ const twoFactorRolesFromSettings = req.client.twoFactorRoles;
236
+ const enforcedTwoFactorRoles = ["admin", "moderator", "editor"];
237
+ const twoFactorRoles = [...new Set([...twoFactorRolesFromSettings, ...enforcedTwoFactorRoles])]
238
239
// if no role is present, assume default role
240
const userRole = req.user.role ? req.user.role : defaultRole;
0 commit comments