diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json
index 20becaed..1a43bc92 100644
--- a/meshcentral-config-schema.json
+++ b/meshcentral-config-schema.json
@@ -345,7 +345,8 @@
"force2factor": { "type": "boolean", "default": false, "description": "Requires that all accounts setup 2FA." },
"skip2factor": { "type": "string", "description": "IP addresses where 2FA login is skipped, for example: 127.0.0.1,192.168.2.0/24" },
"oldPasswordBan": { "type": "integer", "description": "Number of old passwords the server should remember and not allow the user to switch back to." },
- "banCommonPasswords": { "type": "boolean", "default": false, "description": "Uses WildLeek to block use of the 10000 most commonly used passwords." }
+ "banCommonPasswords": { "type": "boolean", "default": false, "description": "Uses WildLeek to block use of the 10000 most commonly used passwords." },
+ "loginTokens": { "type": "boolean", "default": true, "description": "Allows users to create alternative username/passwords for their account." }
}
},
"twoFactorCookieDurationDays": { "type": "integer", "default": 30, "description": "Number of days that a user is allowed to remember this device for when completing 2FA. Set this to 0 to remove this option." },
diff --git a/meshuser.js b/meshuser.js
index 3f05b74b..80ba9137 100644
--- a/meshuser.js
+++ b/meshuser.js
@@ -5610,6 +5610,15 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
}
break;
}
+ case 'createLoginToken': {
+ if ((typeof domain.passwordrequirements != 'object') && (domain.passwordrequirements.logintokens == false)) break; // Login tokens are not supported on this server
+ if (common.validateString(command.name, 1, 100) == false) break; // Check name
+ if ((typeof command.expire != 'number') || (command.expire < 0)) break; // Check expire
+
+ console.log(command);
+
+ break;
+ }
case 'getDeviceDetails': {
if (common.validateStrArray(command.nodeids, 1) == false) break; // Check nodeids
if (common.validateString(command.type, 3, 4) == false) break; // Check type
diff --git a/views/default.handlebars b/views/default.handlebars
index ba5abe2e..9925b45a 100644
--- a/views/default.handlebars
+++ b/views/default.handlebars
@@ -381,6 +381,7 @@
Change password
Delete account
+