1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 17:59:25 +00:00

Add User.shortName

This commit is contained in:
2022-03-03 01:58:47 +00:00
parent dd5778e872
commit 9c66a50973

View File

@@ -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);
}