feat: 🎸 add auth callback pages

This commit is contained in:
Randall Morey committed 2021-04-02 16:06:38 -04:00
1 parent a41572302a
commit a62d36af92
9 files changed
+65

No files matched your search

+4
View File
@@ -1,10 +1,14 @@
auth:
titles:
no-scopes: No Scopes Available
flow-success: Successful authentication
flow-error: Could not authenticate to provider
descriptions:
no-scopes: No scopes were found. To authenticate, ask your administrator to create an scope and grant you access.
choose-org: Choose a scope to authenticate.
authenticating-with-org: "You are authenticating with {name}."
flow-success: You've successfully authenticated. You may now close this window and return to the client.
flow-error: Something went wrong while authenticating with the provider. Please close this window and try again. If the problem persists, notify your administrator.
origin:
connected-to: Connected to
titles:
+3
View File
@@ -7,6 +7,9 @@ export default class Router extends EmberRouter {
}
Router.map(function () {
this.route('authentication-complete');
this.route('authentication-error');
this.route('scopes', function () {
this.route('scope', { path: ':scope_id' }, function () {
this.route('authenticate', function () {
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';
export default class AuthenticationCompleteRoute extends Route {}
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';
export default class AuthenticationErrorRoute extends Route {}
+6
View File
@@ -4,6 +4,12 @@
@import 'rose';
@import 'notify';
.rose-layout-global {
.rose-layout-global-body {
justify-content: center;
}
}
.rose-layout-centered {
> .rose-layout-page {
width: sizing.rems(l) * 18;
@@ -0,0 +1,12 @@
{{page-title (t 'auth.titles.flow-success')}}
<main>
<Rose::Layout::Centered>
<Rose::Notification
@style="success"
@heading={{t "auth.titles.flow-success"}}
>
{{t "auth.descriptions.flow-success"}}
</Rose::Notification>
</Rose::Layout::Centered>
</main>
@@ -0,0 +1,12 @@
{{page-title (t "auth.titles.flow-error")}}
<main>
<Rose::Layout::Centered>
<Rose::Notification
@style="error"
@heading={{t "auth.titles.flow-error"}}
>
{{t "auth.descriptions.flow-error"}}
</Rose::Notification>
</Rose::Layout::Centered>
</main>
@@ -0,0 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | authentication-complete', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup('route:authentication-complete');
assert.ok(route);
});
});
@@ -0,0 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | authentication-error', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup('route:authentication-error');
assert.ok(route);
});
});