Login token server exception fix.

Ylian Saint-Hilaire committed Apr 16, 2021 at 19:31 UTC 8c7bbe9e74b38cb63f9ca9fcc8d3e0f01cfa19ed
1 file changed +2 -2
meshuser.js
+2 -2
@@ -5704,7 +5704,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5704 }
5705 case 'loginTokens': { // Respond with the list of currently valid login tokens
5706 if (req.session.loginToken != null) break; // Do not allow this command when logged in using a login token
5707 - if ((typeof domain.passwordrequirements != 'object') && (domain.passwordrequirements.logintokens == false)) break; // Login tokens are not supported on this server
5707 + if ((typeof domain.passwordrequirements == 'object') && (domain.passwordrequirements.logintokens == false)) break; // Login tokens are not supported on this server
5708
5709 // If remove is an array or strings, we are going to be removing these and returning the results.
5710 if (common.validateStrArray(command.remove, 1) == false) { delete command.remove; }
@@ -5738,7 +5738,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5738 }
5739 case 'createLoginToken': { // Create a new login token
5740 if (req.session.loginToken != null) break; // Do not allow this command when logged in using a login token
5741 - if ((typeof domain.passwordrequirements != 'object') && (domain.passwordrequirements.logintokens == false)) break; // Login tokens are not supported on this server
5741 + if ((typeof domain.passwordrequirements == 'object') && (domain.passwordrequirements.logintokens == false)) break; // Login tokens are not supported on this server
5742 if (common.validateString(command.name, 1, 100) == false) break; // Check name
5743 if ((typeof command.expire != 'number') || (command.expire < 0)) break; // Check expire
5744