feat: Implement users/me API endpoint

This commit is contained in:
Faruk AYDIN
2024-02-13 02:04:50 +01:00
parent 95f89ba03e
commit 9f0e0ca656
7 changed files with 93 additions and 0 deletions

View File

@@ -143,6 +143,17 @@ class User extends Base {
},
});
$formatJson(json) {
json = super.$formatJson(json);
delete json.password;
delete json.deletedAt;
delete json.resetPasswordToken;
delete json.resetPasswordTokenSentAt;
return json;
}
login(password) {
return bcrypt.compare(password, this.password);
}