@@ -117,6 +117,7 @@ function sha512Hash(str, addSalt) {
117117 * @param {Function } callback | Callback function
118118 */
119119function verifyMemberArgon2Hash ( username , password , countlyDb , callback ) {
120+ console . log ( "verifying" , username , password ) ;
120121 var emailVal = null ;
121122 if ( username && typeof username === 'string' ) {
122123 emailVal = username . toString ( ) . toLocaleLowerCase ( ) ;
@@ -126,8 +127,11 @@ function verifyMemberArgon2Hash(username, password, countlyDb, callback) {
126127 }
127128 countlyDb . collection ( 'members' ) . findOne ( { $and : [ { $or : [ { "username" : username } , { "email" : emailVal } ] } ] } , ( err , member ) => {
128129 if ( member ) {
130+ console . log ( "member found" ) ;
129131 if ( isArgon2Hash ( member . password ) ) {
132+ console . log ( "hash is argon" ) ;
130133 verifyArgon2Hash ( member . password , password ) . then ( match => {
134+ console . log ( "password verified" , match ) ;
131135 if ( match ) {
132136 callback ( undefined , member ) ;
133137 }
@@ -139,6 +143,7 @@ function verifyMemberArgon2Hash(username, password, countlyDb, callback) {
139143 } ) ;
140144 }
141145 else {
146+ console . log ( "hash is not argon2" ) ;
142147 var password_SHA1 = sha1Hash ( password ) ;
143148 var password_SHA5 = sha512Hash ( password ) ;
144149
@@ -156,6 +161,7 @@ function verifyMemberArgon2Hash(username, password, countlyDb, callback) {
156161 }
157162 }
158163 else {
164+ console . log ( "member not found" ) ;
159165 callback ( "Username is wrong!" ) ;
160166 }
161167 } ) ;
0 commit comments