diff --git a/.vscode/settings.json b/.vscode/settings.json index 05d23f3bbc..958a4a775c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,10 @@ "eslint.format.enable": true, "[javascript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" - } + }, + "cSpell.words": [ + "loopback", + "salix", + "fdescribe" + ] } diff --git a/back/models/vn-user.js b/back/models/vn-user.js index 29c51509dc..6b9b9bab58 100644 --- a/back/models/vn-user.js +++ b/back/models/vn-user.js @@ -124,6 +124,14 @@ module.exports = function(Self) { return email.send(); }); + + /** + * Sign-in validate. * + * @param {Integer} user The user + * @param {Object} userToken Options + * @param {Object} token accessToken + * @param {Object} ctx context + */ Self.signInValidate = async(user, userToken, token, ctx) => { const [[key, value]] = Object.entries(Self.userUses(user)); const isOwner = Self.rawSql(`SELECT ? = ? `, [userToken[key], value]); @@ -139,6 +147,12 @@ module.exports = function(Self) { } }; + /** + * Validate login params* + * @param {String} user The user + * @param {String} password + * @param {Object} ctx context + */ Self.validateLogin = async function(user, password, ctx) { const loginInfo = Object.assign({password}, Self.userUses(user)); const token = await Self.login(loginInfo, 'user');