@@ -33,9 +33,7 @@ export class CreateAuth {
 | 
				
			|||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            const found_user = found_users[0]
 | 
					            const found_user = found_users[0]
 | 
				
			||||||
            console.log(found_user.password);
 | 
					            console.log(found_user.password);
 | 
				
			||||||
            // try {
 | 
					 | 
				
			||||||
            if (await argon2.verify(found_user.password, this.password + found_user.uuid)) {
 | 
					            if (await argon2.verify(found_user.password, this.password + found_user.uuid)) {
 | 
				
			||||||
                // password match
 | 
					 | 
				
			||||||
                // TODO: proper jwt creation
 | 
					                // TODO: proper jwt creation
 | 
				
			||||||
                const token = jsonwebtoken.sign({}, "securekey")
 | 
					                const token = jsonwebtoken.sign({}, "securekey")
 | 
				
			||||||
                newAuth.access_token = token
 | 
					                newAuth.access_token = token
 | 
				
			||||||
@@ -43,13 +41,8 @@ export class CreateAuth {
 | 
				
			|||||||
                newAuth.access_token_expires_at = 1587349200
 | 
					                newAuth.access_token_expires_at = 1587349200
 | 
				
			||||||
                newAuth.refresh_token_expires_at = 1587349200
 | 
					                newAuth.refresh_token_expires_at = 1587349200
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                // password did not match
 | 
					 | 
				
			||||||
                throw new InvalidCredentialsError()
 | 
					                throw new InvalidCredentialsError()
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //   } catch (err) {
 | 
					 | 
				
			||||||
            //     // internal failure
 | 
					 | 
				
			||||||
            //   }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return newAuth;
 | 
					        return newAuth;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user