chore: 🤖 Update auth templates under scopes
This commit is contained in:
9 files changed
+96
-57
No files matched your search
@@ -38,7 +38,7 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator {
|
||||
* @param {string} scopeID
|
||||
* @return {string}
|
||||
*/
|
||||
buildDeauthEndpointURL({ authenticator, org_id: scopeID }) {
|
||||
buildDeauthEndpointURL({ org_id: scopeID }) {
|
||||
const adapter = this.store.adapterFor('application');
|
||||
const options = { adapterOptions: { method: 'deauthenticate' } };
|
||||
return adapter.buildURL('scope', scopeID, options, 'findRecord');
|
||||
|
||||
@@ -18,7 +18,6 @@ Router.map(function () {
|
||||
this.route('new');
|
||||
});
|
||||
});
|
||||
this.route('cope');
|
||||
});
|
||||
|
||||
this.route('orgs', function () {
|
||||
|
||||
@@ -23,5 +23,4 @@ export default class ScopesScopeRoute extends Route {
|
||||
return maybeExistingScope || this.store.createRecord('scope', { id });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +1,31 @@
|
||||
<Rose::Layout::Sidebar as |sidebarLayout|>
|
||||
{{#if this.session.isAuthenticated}}
|
||||
<sidebarLayout.sidebar>
|
||||
|
||||
<Rose::Nav::Sidebar @title={{t "titles.general"}} as |nav|>
|
||||
<nav.link @route="scopes.scope.projects">
|
||||
{{t "resources.projects"}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
<sidebarLayout.sidebar>
|
||||
<Rose::Nav::Sidebar @title={{t "titles.general"}} as |nav|>
|
||||
<nav.link @route="scopes.scope.projects">
|
||||
{{t "resources.projects"}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
|
||||
{{outlet "sidebar"}}
|
||||
{{outlet "sidebar"}}
|
||||
|
||||
|
||||
{{!--
|
||||
<Rose::Nav::Sidebar @title={{t "titles.iam"}} as |nav|>
|
||||
<nav.link @route="orgs.org.users">
|
||||
{{t "resources.users"}}
|
||||
</nav.link>
|
||||
{{!--
|
||||
<Rose::Nav::Sidebar @title={{t "titles.iam"}} as |nav|>
|
||||
<nav.link @route="orgs.org.users">
|
||||
{{t "resources.users"}}
|
||||
</nav.link>
|
||||
|
||||
<nav.link @route="orgs.org.groups">
|
||||
{{t "resources.groups"}}
|
||||
</nav.link>
|
||||
<nav.link @route="orgs.org.groups">
|
||||
{{t "resources.groups"}}
|
||||
</nav.link>
|
||||
|
||||
<nav.link @route="orgs.org.roles">
|
||||
{{t "resources.roles"}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
--}}
|
||||
|
||||
</sidebarLayout.sidebar>
|
||||
{{/if}}
|
||||
<nav.link @route="orgs.org.roles">
|
||||
{{t "resources.roles"}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
--}}
|
||||
</sidebarLayout.sidebar>
|
||||
|
||||
<sidebarLayout.body>
|
||||
<main>
|
||||
|
||||
@@ -1,5 +1,52 @@
|
||||
<Rose::Layout::Centered>
|
||||
<div id="authentication-view">
|
||||
{{outlet}}
|
||||
</div>
|
||||
<Rose::Layout::Page as |page|>
|
||||
|
||||
<page.header>
|
||||
<h2>{{t 'actions.authenticate'}}</h2>
|
||||
<p>{{t 'auth.descriptions.authenticating-with-org' name=@model.scope.displayName}}</p>
|
||||
</page.header>
|
||||
|
||||
<page.navigation>
|
||||
|
||||
<Rose::Dropdown
|
||||
@text={{t 'actions.choose-different-org'}}
|
||||
@icon="user-organization"
|
||||
as |dropdown|>
|
||||
{{#each @model.scopes as |scope|}}
|
||||
<dropdown.link @route="scopes.scope.authenticate" @model={{scope}}>
|
||||
{{scope.displayName}}
|
||||
</dropdown.link>
|
||||
{{/each}}
|
||||
</Rose::Dropdown>
|
||||
|
||||
<Rose::Separator />
|
||||
|
||||
<Rose::Nav::Tabs as |nav|>
|
||||
{{#each @model.authMethods as |authMethod|}}
|
||||
<nav.link @route="scopes.scope.authenticate.method" @model={{authMethod}}>
|
||||
{{t (concat 'auth.method-types.' authMethod.type)}}
|
||||
</nav.link>
|
||||
{{/each}}
|
||||
</Rose::Nav::Tabs>
|
||||
</page.navigation>
|
||||
|
||||
<page.body>
|
||||
{{#if @model.authMethods}}
|
||||
{{outlet}}
|
||||
{{/if}}
|
||||
{{#unless @model.authMethods}}
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message
|
||||
@title={{t "auth.titles.no-methods"}}
|
||||
@icon="alert-circle-outline"
|
||||
as |message|>
|
||||
<message.description>
|
||||
{{t "auth.descriptions.no-methods"}}
|
||||
</message.description>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
{{/unless}}
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
</Rose::Layout::Centered>
|
||||
@@ -0,0 +1,12 @@
|
||||
{{#unless @model}}
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message
|
||||
@title={{t "auth.titles.no-methods"}}
|
||||
@icon="alert-circle-outline"
|
||||
as |message|>
|
||||
<message.description>
|
||||
{{t "auth.descriptions.no-methods"}}
|
||||
</message.description>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
{{/unless}}
|
||||
@@ -1,29 +1,3 @@
|
||||
{{#if @model}}
|
||||
<h2>{{t 'actions.authenticate'}}</h2>
|
||||
<p>{{t "auth.descriptions.choose-org"}}</p>
|
||||
<Rose::Dropdown
|
||||
@text={{t 'actions.choose-org'}}
|
||||
@icon="user-organization"
|
||||
as |dropdown|>
|
||||
{{#each @model as |org|}}
|
||||
<dropdown.link @route="orgs.org.authenticate" @model={{org}}>
|
||||
{{org.displayName}}
|
||||
</dropdown.link>
|
||||
{{/each}}
|
||||
</Rose::Dropdown>
|
||||
{{/if}}
|
||||
|
||||
{{#unless @model}}
|
||||
<Rose::Message
|
||||
@title={{t "auth.titles.no-orgs"}}
|
||||
@icon="alert-circle-outline"
|
||||
as |message|>
|
||||
<message.description>
|
||||
{{t "auth.descriptions.no-orgs"}}
|
||||
</message.description>
|
||||
</Rose::Message>
|
||||
{{/unless}}
|
||||
|
||||
<Rose::Form
|
||||
@onSubmit={{route-action "authenticate" (hash
|
||||
identification=this.identification
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{outlet}}
|
||||
{{outlet}}
|
||||
@@ -10,6 +10,17 @@ export default function(server) {
|
||||
|
||||
const scope = { id: orgScope.id, type: orgScope.type };
|
||||
|
||||
// Create additional scopes for authentication organization selection
|
||||
server.create('scope', {
|
||||
type: 'org',
|
||||
scope: { id: globalScope.id, type: globalScope.type }
|
||||
}, 'withChildren');
|
||||
|
||||
server.create('scope', {
|
||||
type: 'org',
|
||||
scope: { id: globalScope.id, type: globalScope.type }
|
||||
}, 'withChildren');
|
||||
|
||||
// Auth
|
||||
|
||||
// Auth methods exist both at the global scope and the org scope.
|
||||
|
||||
Reference in new issue
Block a user