validate authentication use case

This commit is contained in:
sbriat
2023-07-11 11:43:56 +02:00
parent 92ce0cd93a
commit 487ae9c38e
13 changed files with 357 additions and 3 deletions

View File

@@ -47,6 +47,9 @@ export class AuthenticationEntity extends AggregateRoot<AuthenticationProps> {
);
}
authenticate = async (password: string): Promise<boolean> =>
await bcrypt.compare(password, this.props.password);
validate(): void {
// entity business rules validation to protect it's invariant before saving entity to a database
}