mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 22:59:28 +00:00
Add User.shortName
This commit is contained in:
@@ -14,6 +14,8 @@ class User {
|
||||
firstName;
|
||||
otherNames;
|
||||
lastName;
|
||||
shortName;
|
||||
fullName;
|
||||
email;
|
||||
#password;
|
||||
type = null;
|
||||
@@ -61,6 +63,7 @@ class User {
|
||||
this[k] = v;
|
||||
|
||||
this.type = type;
|
||||
this.shortName = this.getShortName();
|
||||
this.fullName = this.getFullName();
|
||||
|
||||
if (knownType)
|
||||
@@ -86,6 +89,10 @@ class User {
|
||||
return name;
|
||||
}
|
||||
|
||||
getShortName() {
|
||||
return `${this.firstName} ${this.lastName}`;
|
||||
}
|
||||
|
||||
async verifyPassword(password) {
|
||||
return await bcrypt.compare(password, this.password);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user