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