2020-08-12 17:16:41 -04:00
|
|
|
import Route from '@ember/routing/route';
|
2021-06-01 22:29:19 -04:00
|
|
|
import { action } from '@ember/object';
|
|
|
|
|
import { notifySuccess, notifyError } from 'core/decorators/notify';
|
2020-08-12 17:16:41 -04:00
|
|
|
|
|
|
|
|
export default class ScopesScopeAuthMethodsAuthMethodRoute extends Route {
|
|
|
|
|
// =methods
|
|
|
|
|
|
|
|
|
|
/**
|
2020-09-16 09:48:07 -04:00
|
|
|
* Load an auth method by ID.
|
2020-08-12 17:16:41 -04:00
|
|
|
* @param {object} params
|
|
|
|
|
* @param {string} params.auth_method_id
|
|
|
|
|
* @return {authMethodModel}
|
|
|
|
|
*/
|
2020-09-09 12:24:01 -04:00
|
|
|
async model({ auth_method_id }) {
|
|
|
|
|
return this.store.findRecord('auth-method', auth_method_id);
|
2020-08-12 17:16:41 -04:00
|
|
|
}
|
2020-09-14 15:58:06 -04:00
|
|
|
|
2021-06-01 22:29:19 -04:00
|
|
|
// =actions
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update state of OIDC auth method
|
2021-06-02 22:22:02 -04:00
|
|
|
* @param {string} state
|
2021-06-01 22:29:19 -04:00
|
|
|
*/
|
|
|
|
|
@action
|
|
|
|
|
@notifyError(({ message }) => message)
|
|
|
|
|
@notifySuccess('notifications.save-success')
|
|
|
|
|
async changeState(state) {
|
|
|
|
|
const model = this.modelFor('scopes.scope.auth-methods.auth-method');
|
|
|
|
|
await model.changeState(state);
|
|
|
|
|
}
|
2020-08-12 17:16:41 -04:00
|
|
|
}
|