...

/

Solution: Adding Authentication

Solution: Adding Authentication

Review the solution for the Adding Authentication challenge.

We'll cover the following...

Task 1

Add the following check_password method in the src/users/controller.ts file:

Press + to interact
private async check_Password(password: string, user: User) {
const hashedPassword = hashWithSalt(password, user.salt);
if (hashedPassword === user.hash) {
return Promise.resolve(true);
}
return Promise.reject(false);
}

Then make the following call ...