Skip to content

Commit

Permalink
Added support for node 4.3 and some documentation to Authentication.js (
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanwinkle authored and flovilmart committed Aug 30, 2016
1 parent b94a31e commit 0b08110
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Parse-Dashboard/Authentication.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
"use strict";

/**
* Constructor for Authentication class
*
* @class Authentication
* @param {Object[]} validUsers
* @param {boolean} useEncryptedPasswords
*/
function Authentication(validUsers, useEncryptedPasswords) {
this.validUsers = validUsers;
this.useEncryptedPasswords = useEncryptedPasswords || false;
}

Authentication.prototype.authenticate = function (userToTest) {
/**
* Authenticates the `userToTest`
*
* @param {Object} userToTest
* @returns {Object} Object with `isAuthenticated` and `appsUserHasAccessTo` properties
*/
function authenticate(userToTest) {
let bcrypt = require('bcryptjs');

var appsUserHasAccessTo = null;
Expand All @@ -29,6 +43,8 @@ Authentication.prototype.authenticate = function (userToTest) {
isAuthenticated,
appsUserHasAccessTo
};
};
}

Authentication.prototype.authenticate = authenticate;

module.exports = Authentication;

0 comments on commit 0b08110

Please sign in to comment.