You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
689 B
29 lines
689 B
const AuthUser = require('flitter-auth/model/User')
|
|
|
|
/*
|
|
* Auth user model. This inherits fields and methods from the default
|
|
* flitter-auth/model/User model, however you can override methods and
|
|
* properties here as you need.
|
|
*/
|
|
class User extends AuthUser {
|
|
static get services() {
|
|
return [...super.services, 'auth']
|
|
}
|
|
|
|
static get schema() {
|
|
return {...super.schema, ...{
|
|
// other schema fields here
|
|
}}
|
|
}
|
|
|
|
async check_password(password) {
|
|
return this.get_provider().check_user_auth(this, password)
|
|
}
|
|
|
|
get_provider() {
|
|
return this.auth.get_provider(this.provider)
|
|
}
|
|
}
|
|
|
|
module.exports = exports = User
|