diff --git a/js/src/common/extend.js b/js/src/common/extend.js index 54f41cd..8e49d35 100644 --- a/js/src/common/extend.js +++ b/js/src/common/extend.js @@ -1,7 +1,9 @@ import Extend from 'flarum/common/extenders'; import Client from "./models/Client"; +import Scope from "./models/Scope"; export default [ new Extend.Store() - .add('oauth-clients', Client), + .add('oauth-clients', Client) + .add('oauth-scopes', Scope), ]; diff --git a/js/src/common/models/Scope.js b/js/src/common/models/Scope.js new file mode 100644 index 0000000..2bf3eea --- /dev/null +++ b/js/src/common/models/Scope.js @@ -0,0 +1,9 @@ +import Model from 'flarum/common/Model'; + +export default class Client extends Model { + scope = Model.attribute('scope'); + is_default = Model.attribute('is_default', value => value === 1); + scope_name = Model.attribute('scope_name'); + scope_icon = Model.attribute('scope_icon'); + scope_desc = Model.attribute('scope_desc'); +}