Skip to content

Commit 0b08110

Browse files
dvanwinkleflovilmart
authored andcommitted
Added support for node 4.3 and some documentation to Authentication.js (#513)
1 parent b94a31e commit 0b08110

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Parse-Dashboard/Authentication.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
"use strict";
2+
3+
/**
4+
* Constructor for Authentication class
5+
*
6+
* @class Authentication
7+
* @param {Object[]} validUsers
8+
* @param {boolean} useEncryptedPasswords
9+
*/
210
function Authentication(validUsers, useEncryptedPasswords) {
311
this.validUsers = validUsers;
412
this.useEncryptedPasswords = useEncryptedPasswords || false;
513
}
614

7-
Authentication.prototype.authenticate = function (userToTest) {
15+
/**
16+
* Authenticates the `userToTest`
17+
*
18+
* @param {Object} userToTest
19+
* @returns {Object} Object with `isAuthenticated` and `appsUserHasAccessTo` properties
20+
*/
21+
function authenticate(userToTest) {
822
let bcrypt = require('bcryptjs');
923

1024
var appsUserHasAccessTo = null;
@@ -29,6 +43,8 @@ Authentication.prototype.authenticate = function (userToTest) {
2943
isAuthenticated,
3044
appsUserHasAccessTo
3145
};
32-
};
46+
}
47+
48+
Authentication.prototype.authenticate = authenticate;
3349

3450
module.exports = Authentication;

0 commit comments

Comments
 (0)