Implement OAuth2 server, link oauth:Client and auth::Oauth2Client, implement permission checks
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const { Model } = require('flitter-orm')
|
||||
|
||||
class ServiceProviderModel extends Model {
|
||||
static get services() {
|
||||
return [...super.services, 'models']
|
||||
}
|
||||
|
||||
static get schema() {
|
||||
return {
|
||||
name: String,
|
||||
@@ -11,6 +15,11 @@ class ServiceProviderModel extends Model {
|
||||
}
|
||||
}
|
||||
|
||||
async application() {
|
||||
const Application = this.models.get('Application')
|
||||
return Application.findOne({ active: true, saml_service_provider_ids: this.id })
|
||||
}
|
||||
|
||||
to_api() {
|
||||
return {
|
||||
id: this.id,
|
||||
|
||||
Reference in New Issue
Block a user