feat: 🎸 add OIDC change state custom method

This commit is contained in:
Randall Morey committed 2021-05-13 14:10:37 -04:00
1 parent e91612b313
commit 24e37d3faa
4 files changed
+167 -2

No files matched your search

+25
View File
@@ -44,4 +44,29 @@ export default class AuthMethodModel extends GeneratedAuthMethodModel {
get isOIDC() {
return this.type === 'oidc';
}
// =methods
/**
* Change the active and visibility state of an OIDC auth method
* given its ID.
* For OIDC auth methods only.
* @param {[string]} state
* @param {object} options
* @param {object} options.adapterOptions
* @return {Promise}
*/
changeState(state, options = { adapterOptions: {} }) {
const defaultAdapterOptions = {
method: 'change-state',
state,
};
return this.save({
...options,
adapterOptions: {
...defaultAdapterOptions,
...options.adapterOptions,
},
});
}
}