mirror of
https://gitlab.com/mobicoop/v3/service/auth.git
synced 2026-03-29 15:15:49 +00:00
validate authentication use case
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user