feat: add login mutation

This commit is contained in:
Ali BARIN
2021-12-21 10:05:16 +01:00
parent 8b05489e40
commit e0f380026e
4 changed files with 50 additions and 1 deletions
+4
View File
@@ -32,6 +32,10 @@ class User extends Base {
}
})
login(password: string) {
return bcrypt.compare(password, this.password);
}
async generateHash() {
this.password = await bcrypt.hash(this.password, 10);
}