diff --git a/ui/core/app/router.js b/ui/core/app/router.js index da0c7dcce..af71f6132 100644 --- a/ui/core/app/router.js +++ b/ui/core/app/router.js @@ -38,6 +38,7 @@ Router.map(function () { }); this.route('auth-methods', function() { this.route('auth-method', { path: ':auth_method_id' }, function() {}); + this.route('new'); }); }); }); diff --git a/ui/core/app/routes/scopes/scope/auth-methods.js b/ui/core/app/routes/scopes/scope/auth-methods.js index 91c6ac1f4..ffad801fa 100644 --- a/ui/core/app/routes/scopes/scope/auth-methods.js +++ b/ui/core/app/routes/scopes/scope/auth-methods.js @@ -44,7 +44,7 @@ export default class ScopesScopeAuthMethodsRoute extends Route { this.notify.success( this.intl.t(isNew ? 'notify.create-success' : 'notify.save-success') ); - this.transitionTo('scopes.scope.auth-methods.auth-method'); + this.transitionTo('scopes.scope.auth-methods.auth-method', authMethod); } catch (error) { //TODO: replace with translated strings this.notify.error(error.message, { closeAfter: null }); diff --git a/ui/core/app/routes/scopes/scope/auth-methods/new.js b/ui/core/app/routes/scopes/scope/auth-methods/new.js new file mode 100644 index 000000000..ceeb6a5d7 --- /dev/null +++ b/ui/core/app/routes/scopes/scope/auth-methods/new.js @@ -0,0 +1,14 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeAuthMethodsNewRoute extends Route { + // =methods + + /** + * Create a new unsaved auth-method. + * @return {AuthMethodModel} + */ + model() { + const scopeModel = this.modelFor('scopes.scope'); + return this.store.createRecord('auth-method', { type: 'password', scopeModel }); + } +} diff --git a/ui/core/app/templates/scopes/scope/auth-methods/index.hbs b/ui/core/app/templates/scopes/scope/auth-methods/index.hbs index 9d741b6cd..61c7a08e4 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods/index.hbs @@ -3,6 +3,14 @@