File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
+
3
+ /**
4
+ * Constructor for Authentication class
5
+ *
6
+ * @class Authentication
7
+ * @param {Object[] } validUsers
8
+ * @param {boolean } useEncryptedPasswords
9
+ */
2
10
function Authentication ( validUsers , useEncryptedPasswords ) {
3
11
this . validUsers = validUsers ;
4
12
this . useEncryptedPasswords = useEncryptedPasswords || false ;
5
13
}
6
14
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 ) {
8
22
let bcrypt = require ( 'bcryptjs' ) ;
9
23
10
24
var appsUserHasAccessTo = null ;
@@ -29,6 +43,8 @@ Authentication.prototype.authenticate = function (userToTest) {
29
43
isAuthenticated,
30
44
appsUserHasAccessTo
31
45
} ;
32
- } ;
46
+ }
47
+
48
+ Authentication . prototype . authenticate = authenticate ;
33
49
34
50
module . exports = Authentication ;
You can’t perform that action at this time.
0 commit comments