Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
lastName: string;
@prop()
@JsonProperty()
password?: string;
@prop()
@JsonProperty()
picture?: string;
// Providers data
@prop() facebook?: string;
@arrayProp({ items: AuthToken }) tokens?: AuthToken[];
@prop()
@JsonProperty({
use: String
})
get fullName() {
return `${this.firstName} ${this.lastName}`;
}
@instanceMethod
matchPassword(candidatePassword: string) {
return new Promise((resolve) => {
bcrypt.compare(String(candidatePassword), this.password, (err, isMatch) => {
if (err || !isMatch) return resolve(false);
resolve(true);
});
});
}