Skip to content

Modular logistics and supply chain operating system (LSOS)

feat(oauth): offer provider sign-up on the sign-up page

Ronald A. Richardson036d0d7eaf9b
diff --git a/.gitignore b/.gitignore
index 3efbc8c3..238a1fce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,26 +28,6 @@ composer-auth.json
docker/database/*
docker/database/mysql/*
.talismanrc
-verdaccio/minio
-verdaccio/config/htpasswd
-verdaccio/storage
-docker/vroom
-# private packages
-packages/billing
-packages/flespi
-packages/loconav
-packages/internals
-packages/projectargus-engine
-packages/solid
-packages/aws-marketplace
-packages/countries
-packages/fliit
-packages/samsara
-packages/solid*
-packages/valhalla
-packages/vroom
-solid
-verdaccio
# asdf
.tools-versions
# binary build resources
diff --git a/console/app/components/account/connected-accounts.hbs b/console/app/components/account/connected-accounts.hbs
index 9d00cfa1..e9d8455a 100644
--- a/console/app/components/account/connected-accounts.hbs
+++ b/console/app/components/account/connected-accounts.hbs
@@ -9,7 +9,7 @@
<div class="flex items-center justify-between rounded-md border border-gray-200 dark:border-gray-700 px-3 py-2">
<div class="flex items-center">
<span class="mr-3 inline-flex text-gray-700 dark:text-gray-200">
- <Auth::OauthProviderLogo @provider={{identity.provider}} @icon={{identity.icon}} />
+ <OauthProviderLogo @provider={{identity.provider}} @icon={{identity.icon}} />
</span>
<div>
<div class="text-sm font-semibold text-gray-900 dark:text-white">{{identity.label}}</div>
@@ -42,7 +42,7 @@
<div class="flex items-center justify-between rounded-md border border-dashed border-gray-300 dark:border-gray-700 px-3 py-2">
<div class="flex items-center">
<span class="mr-3 inline-flex text-gray-700 dark:text-gray-200">
- <Auth::OauthProviderLogo @provider={{provider.id}} @icon={{provider.icon}} />
+ <OauthProviderLogo @provider={{provider.id}} @icon={{provider.icon}} />
</span>
<div class="text-sm text-gray-700 dark:text-gray-300">{{provider.label}}</div>
</div>
diff --git a/console/app/components/auth/oauth-provider-logo.hbs b/console/app/components/auth/oauth-provider-logo.hbs
deleted file mode 100644
index 63ff8bfb..00000000
--- a/console/app/components/auth/oauth-provider-logo.hbs
+++ /dev/null
@@ -1,27 +0,0 @@
-{{!-- A provider's own logo, as its brand guidelines require it to be shown.
- Google and Microsoft must be full colour (a single-colour Google "G" is not
- allowed), so they are inline SVG. Apple and GitHub are single colour by design
- and follow the button's text colour. Any other provider falls back to its icon. --}}
-{{#if (eq @provider "google")}}
- <span class="oauth-provider-logo oauth-provider-logo-google" aria-hidden="true">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="18" height="18">
- <path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" />
- <path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" />
- <path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" />
- <path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" />
- </svg>
- </span>
-{{else if (eq @provider "microsoft")}}
- <span class="oauth-provider-logo oauth-provider-logo-microsoft" aria-hidden="true">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 21" width="18" height="18">
- <rect x="1" y="1" width="9" height="9" fill="#F25022" />
- <rect x="11" y="1" width="9" height="9" fill="#7FBA00" />
- <rect x="1" y="11" width="9" height="9" fill="#00A4EF" />
- <rect x="11" y="11" width="9" height="9" fill="#FFB900" />
- </svg>
- </span>
-{{else if @icon}}
- <span class="oauth-provider-logo oauth-provider-logo-{{@provider}}" aria-hidden="true">
- <FaIcon @icon={{@icon}} @prefix="fab" />
- </span>
-{{/if}}
diff --git a/console/app/components/onboarding/form.hbs b/console/app/components/onboarding/form.hbs
index c00c7767..67fbe256 100644
--- a/console/app/components/onboarding/form.hbs
+++ b/console/app/components/onboarding/form.hbs
@@ -20,6 +20,27 @@
</p>
</div>
+ {{!-- Sign up with a provider instead of a password. Only when an administrator
+ allows sign-ups through one, and not once the form is already prefilled
+ from a provider. --}}
+ {{#if (and this.oauth.canSignUp (not this.hasOauthIntent))}}
+ <div class="space-y-2" data-test-oauth-signup>
+ {{#each this.oauth.providers as |provider|}}
+ <OauthProviderButton
+ @provider={{provider}}
+ @text={{t "auth.login.oauth.continue-with" provider=provider.label}}
+ @disabled={{this.isStartingProvider}}
+ @onClick={{this.continueWithProvider}}
+ />
+ {{/each}}
+ </div>
+ <div class="flex items-center py-3">
+ <div class="flex-grow border-t border-gray-300 dark:border-gray-700"></div>
+ <span class="px-3 text-xs font-medium text-gray-500 uppercase dark:text-gray-400">{{t "onboard.index.oauth-divider"}}</span>
+ <div class="flex-grow border-t border-gray-300 dark:border-gray-700"></div>
+ </div>
+ {{/if}}
+
<form {{on "submit" (perform this.onboard)}}>
{{#if this.error}}
<InfoBlock @icon="exclamation-triangle" @text={{this.error}} class="mb-6 px-3 py-2 bg-red-300 text-red-900" @textClass="text-red-900" />
diff --git a/console/app/components/onboarding/form.js b/console/app/components/onboarding/form.js
index 2d7b6e6a..38124474 100644
--- a/console/app/components/onboarding/form.js
+++ b/console/app/components/onboarding/form.js
@@ -1,7 +1,7 @@
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
-import { getProperties } from '@ember/object';
+import { action, getProperties } from '@ember/object';
import { isBlank } from '@ember/utils';
import { task } from 'ember-concurrency';
import { onboardValidationsFor } from '../../validations/onboard';
@@ -50,6 +50,27 @@ export default class OnboardingFormComponent extends Component {
return !isBlank(this.oauthIntent);
}
+ /**
+ * Set once a provider button is pressed, while the browser leaves for the provider.
+ *
+ * @var {Boolean}
+ */
+ @tracked isStartingProvider = false;
+
+ /**
+ * Sign up with a provider. The same handshake as the login page's buttons, marked as
+ * a sign-up: an unknown identity comes back here with the form prefilled, and one
+ * that already has an account is signed in and told so.
+ */
+ @action continueWithProvider(provider) {
+ if (this.isStartingProvider || !provider?.id) {
+ return;
+ }
+
+ this.isStartingProvider = true;
+ this.oauth.startAuthorization(provider.id, { intent: 'signup' });
+ }
+
/**
* The email came from the provider and the API will verify the intent against it,
* so editing it here would only produce a mismatch the server rejects.
diff --git a/console/app/controllers/auth/oauth-callback.js b/console/app/controllers/auth/oauth-callback.js
index 0addeebd..e8d7e369 100644
--- a/console/app/controllers/auth/oauth-callback.js
+++ b/console/app/controllers/auth/oauth-callback.js
@@ -127,6 +127,12 @@ export default class AuthOauthCallbackController extends Controller {
this.notifications.info(this.intl.t('auth.login.oauth.auto-linked', { provider: response.linked_label ?? response.linked }));
}
+ // They pressed a provider button on the sign-up page but already had an account,
+ // so they are being signed in to it rather than signed up.
+ if (response.existing_account) {
+ this.notifications.info(this.intl.t('auth.login.oauth.existing-account'));
+ }
+
// 2FA is not waived for a provider sign-in — the server issues no token until
// the second factor is satisfied.
if (response.isEnabled === true && response.twoFaSession) {
diff --git a/console/app/routes/onboard/index.js b/console/app/routes/onboard/index.js
index b3000175..c78beef4 100644
--- a/console/app/routes/onboard/index.js
+++ b/console/app/routes/onboard/index.js
@@ -3,6 +3,7 @@ import { inject as service } from '@ember/service';
export default class OnboardIndexRoute extends Route {
@service store;
+ @service oauth;
@service('onboarding-orchestrator') orchestrator;
queryParams = {
@@ -14,6 +15,10 @@ export default class OnboardIndexRoute extends Route {
beforeModel() {
// Resume from previous session if data exists in localStorage
this.orchestrator.start(null, { resume: true });
+
+ // For the "Continue with ..." buttons on the sign-up form. Not awaited: a failure
+ // leaves the list empty and the form is exactly what it was before OAuth.
+ this.oauth.loadProviders();
}
model() {
diff --git a/console/app/services/oauth.js b/console/app/services/oauth.js
index 25290d13..56d61323 100644
--- a/console/app/services/oauth.js
+++ b/console/app/services/oauth.js
@@ -22,6 +22,15 @@ export default class OauthService extends Service {
*/
@tracked providers = [];
+ /**
+ * Whether an administrator allows new accounts through a provider. When they don't,
+ * the sign-up page leaves its provider buttons out rather than let someone find out
+ * after the round trip.
+ *
+ * @var {Boolean}
+ */
+ @tracked allowsRegistration = false;
+
@tracked isLoading = false;
/**
@@ -43,6 +52,13 @@ export default class OauthService extends Service {
return this.providers.length > 0;
}
+ /**
+ * Whether the sign-up page should offer provider buttons.
+ */
+ get canSignUp() {
+ return this.isEnabled && this.allowsRegistration;
+ }
+
/**
* Ask the API which providers are enabled.
*
@@ -61,10 +77,12 @@ export default class OauthService extends Service {
this.isLoading = true;
try {
- const { providers } = await this.fetch.get('auth/oauth/providers');
+ const { providers, allow_registration } = await this.fetch.get('auth/oauth/providers');
this.providers = Array.isArray(providers) ? providers : [];
+ this.allowsRegistration = allow_registration === true;
} catch (error) {
this.providers = [];
+ this.allowsRegistration = false;
} finally {
this.isLoading = false;
}
diff --git a/console/app/styles/console.css b/console/app/styles/console.css
index cd20ceda..8b6c0672 100644
--- a/console/app/styles/console.css
+++ b/console/app/styles/console.css
@@ -243,93 +243,3 @@ body[data-theme='dark'] .console-dashboard-title h1 {
padding: 1rem;
}
}
-
-
-/*
- * Sign-in provider buttons: each provider's logo and light-mode colours on Fleetbase's
- * own button shape, size, shadow and icon position.
- *
- * Light Google and Microsoft: white with Fleetbase's usual button border, the
- * full-colour logo (Google forbids a single-colour "G"; Microsoft forbids
- * altering its logo). Apple: black (Apple HIG). GitHub: #24292F — its mark
- * is only ever shown in black or white.
- * Dark Every provider on Fleetbase's gray-900, so the page reads as one set of
- * buttons. Apple and GitHub marks turn white with the text; the Google "G"
- * keeps a white disc, since Google requires it on white.
- *
- * Only these providers are listed, so one added later keeps the default button.
- * `body` in each selector outranks ember-ui's `body[data-theme='dark'] .btn.btn-default`
- * rules, hover included.
- */
-.oauth-provider-google,
-.oauth-provider-microsoft {
- --oauth-bg: #ffffff;
- --oauth-bg-hover: #f3f4f6; /* gray-100 */
- --oauth-border: #d1d5db; /* gray-300, Fleetbase's default button border */
- --oauth-border-hover: #9ca3af; /* gray-400 */
- --oauth-text: #1f2937; /* gray-800 */
-}
-.oauth-provider-apple {
- --oauth-bg: #000000;
- --oauth-bg-hover: #262626;
- --oauth-border: #000000;
- --oauth-border-hover: #262626;
- --oauth-text: #ffffff;
-}
-.oauth-provider-github {
- --oauth-bg: #24292f;
- --oauth-bg-hover: #3a4149;
- --oauth-border: #24292f;
- --oauth-border-hover: #3a4149;
- --oauth-text: #ffffff;
-}
-body[data-theme='dark'] :is(.oauth-provider-google, .oauth-provider-microsoft, .oauth-provider-apple, .oauth-provider-github) {
- --oauth-bg: #111827; /* gray-900 */
- --oauth-bg-hover: #1f2937; /* gray-800 */
- --oauth-border: #374151; /* gray-700 */
- --oauth-border-hover: #4b5563; /* gray-600 */
- --oauth-text: #f3f4f6; /* gray-100 */
-}
-
-body :is(.oauth-provider-google, .oauth-provider-microsoft, .oauth-provider-apple, .oauth-provider-github) > button.btn.btn-default {
- background-color: var(--oauth-bg);
- border: 1px solid var(--oauth-border);
- color: var(--oauth-text);
- transition:
- background-color 150ms ease,
- border-color 150ms ease;
-}
-
-body :is(.oauth-provider-google, .oauth-provider-microsoft, .oauth-provider-apple, .oauth-provider-github) > button.btn.btn-default:hover:not(:disabled) {
- background-color: var(--oauth-bg-hover);
- border-color: var(--oauth-border-hover);
- color: var(--oauth-text);
-}
-
-body :is(.oauth-provider-google, .oauth-provider-microsoft, .oauth-provider-apple, .oauth-provider-github) > button.btn.btn-default:focus {
- border-color: var(--oauth-border-hover);
- color: var(--oauth-text);
-}
-
-.oauth-provider-logo {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- line-height: 1;
-}
-
-.oauth-provider-logo svg {
- width: 16px;
- height: 16px;
-}
-
-body[data-theme='dark'] .oauth-provider-google .oauth-provider-logo-google {
- background-color: #ffffff;
- border-radius: 9999px;
- padding: 2px;
-}
-
-body[data-theme='dark'] .oauth-provider-google .oauth-provider-logo-google svg {
- width: 14px;
- height: 14px;
-}
diff --git a/console/app/templates/auth/login.hbs b/console/app/templates/auth/login.hbs
index dc272781..a924262b 100644
--- a/console/app/templates/auth/login.hbs
+++ b/console/app/templates/auth/login.hbs
@@ -101,21 +101,15 @@
<div class="flex-grow border-t border-gray-300 dark:border-gray-700"></div>
</div>
- {{!-- Branded per provider (see .oauth-provider-button in console.css): each
- provider's colours and logo, on Fleetbase's own button shape and shadow. --}}
+ {{!-- ember-ui's OauthProviderButton: each provider's logo and colours on the
+ shared btn-auth button, the same buttons the sign-up page shows. --}}
{{#each this.oauth.providers as |provider|}}
- <Button
- @wrapperClass="btn-block oauth-provider-button oauth-provider-{{provider.id}}"
+ <OauthProviderButton
+ @provider={{provider}}
+ @text={{t "auth.login.oauth.continue-with" provider=provider.label}}
@disabled={{this.isLoading}}
- @onClick={{fn this.continueWithProvider provider}}
- data-test-oauth-provider={{provider.id}}
- >
- {{!-- In Fleetbase's icon slot, so the logo sits at the far left like other buttons. --}}
- <span class="btn-icon-wrapper">
- <Auth::OauthProviderLogo @provider={{provider.id}} @icon={{provider.icon}} />
- </span>
- <span>{{t "auth.login.oauth.continue-with" provider=provider.label}}</span>
- </Button>
+ @onClick={{this.continueWithProvider}}
+ />
{{/each}}
{{/if}}
<RegistryYield @type="menu" @registry="auth:login" as |menuItem|>
diff --git a/console/tests/integration/components/auth/oauth-provider-logo-test.js b/console/tests/integration/components/auth/oauth-provider-logo-test.js
deleted file mode 100644
index 6cff6c7e..00000000
--- a/console/tests/integration/components/auth/oauth-provider-logo-test.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import { module, test } from 'qunit';
-import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
-import { render } from '@ember/test-helpers';
-import { hbs } from 'ember-cli-htmlbars';
-
-module('Integration | Component | auth/oauth-provider-logo', function (hooks) {
- setupRenderingTest(hooks);
-
- test('google gets its full-colour G, never a single-colour icon', async function (assert) {
- await render(hbs`<Auth::OauthProviderLogo @provider="google" @icon="google" />`);
-
- const fills = [...this.element.querySelectorAll('path')].map((path) => path.getAttribute('fill'));
-
- assert.deepEqual(fills, ['#EA4335', '#4285F4', '#FBBC05', '#34A853']);
- assert.dom('.svg-inline--fa').doesNotExist();
- });
-
- test('microsoft gets its four-colour logo', async function (assert) {
- await render(hbs`<Auth::OauthProviderLogo @provider="microsoft" @icon="microsoft" />`);
-
- const fills = [...this.element.querySelectorAll('rect')].map((rect) => rect.getAttribute('fill'));
-
- assert.deepEqual(fills, ['#F25022', '#7FBA00', '#00A4EF', '#FFB900']);
- });
-
- test('apple, github and any later provider use their brand icon', async function (assert) {
- await render(hbs`<Auth::OauthProviderLogo @provider="github" @icon="github" />`);
-
- assert.dom('.oauth-provider-logo-github .svg-inline--fa').exists();
- });
-
- test('it is hidden from screen readers; the button text names the provider', async function (assert) {
- await render(hbs`<Auth::OauthProviderLogo @provider="google" />`);
-
- assert.dom('.oauth-provider-logo').hasAttribute('aria-hidden', 'true');
- });
-});
diff --git a/console/tests/integration/components/onboarding/form-test.js b/console/tests/integration/components/onboarding/form-test.js
index 3e632c15..48f44db1 100644
--- a/console/tests/integration/components/onboarding/form-test.js
+++ b/console/tests/integration/components/onboarding/form-test.js
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
-import { render, fillIn } from '@ember/test-helpers';
+import { render, fillIn, click } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import Service from '@ember/service';
import OnboardingFormComponent from '@fleetbase/console/components/onboarding/form';
@@ -338,4 +338,61 @@ module('Integration | Component | onboarding/form | onboard', function (hooks) {
assert.notOk(context.data.oauth_intent, 'the intent is not held in the context');
assert.strictEqual(context.data.organization_name, 'Compiler Logistics', 'other values still merge');
});
+
+ test('it offers the provider buttons when sign-ups through a provider are open', async function (assert) {
+ const oauth = this.owner.lookup('service:oauth');
+ oauth.providers = [
+ { id: 'google', label: 'Google', icon: 'google' },
+ { id: 'github', label: 'GitHub', icon: 'github' },
+ ];
+ oauth.allowsRegistration = true;
+ const started = [];
+ oauth.startAuthorization = (id, options) => started.push([id, options]);
+
+ await render(hbs`<Onboarding::Form />`);
+
+ assert.dom('[data-test-oauth-signup] [data-test-oauth-provider]').exists({ count: 2 });
+ assert.dom('[data-test-oauth-signup]').containsText('Continue with Google');
+ assert.dom(this.element).containsText('Or sign up with email');
+
+ await click('[data-test-oauth-provider="google"]');
+
+ assert.deepEqual(started, [['google', { intent: 'signup' }]], 'the handshake is marked as a sign-up');
+ });
+
+ test('it leaves the provider buttons out when sign-ups are closed', async function (assert) {
+ const oauth = this.owner.lookup('service:oauth');
+ oauth.providers = [{ id: 'google', label: 'Google', icon: 'google' }];
+ oauth.allowsRegistration = false;
+
+ await render(hbs`<Onboarding::Form />`);
+
+ assert.dom('[data-test-oauth-signup]').doesNotExist();
+ assert.dom(this.element).doesNotContainText('Or sign up with email');
+ });
+
+ test('it leaves the provider buttons out once the form is prefilled from a provider', async function (assert) {
+ const oauth = this.owner.lookup('service:oauth');
+ oauth.providers = [{ id: 'google', label: 'Google', icon: 'google' }];
+ oauth.allowsRegistration = true;
+ oauth.setRegistration({ intent: 'rti_abc', prefill: { name: 'Ada Lovelace', email: '[email protected]' } });
+
+ await render(hbs`<Onboarding::Form />`);
+
+ assert.dom('[data-test-oauth-signup]').doesNotExist();
+ });
+
+ test('a second press while leaving for the provider does nothing', async function (assert) {
+ const captured = captureComponent(this.owner, 'onboarding/form', OnboardingFormComponent);
+ const oauth = this.owner.lookup('service:oauth');
+ const started = [];
+ oauth.startAuthorization = (id) => started.push(id);
+
+ await render(hbs`<Onboarding::Form />`);
+ captured.instance.continueWithProvider({ id: 'google' });
+ captured.instance.continueWithProvider({ id: 'google' });
+ captured.instance.continueWithProvider(null);
+
+ assert.deepEqual(started, ['google']);
+ });
});
diff --git a/console/tests/unit/controllers/auth/oauth-callback-test.js b/console/tests/unit/controllers/auth/oauth-callback-test.js
index c8fd7e6a..09099608 100644
--- a/console/tests/unit/controllers/auth/oauth-callback-test.js
+++ b/console/tests/unit/controllers/auth/oauth-callback-test.js
@@ -132,6 +132,15 @@ module('Unit | Controller | auth/oauth-callback', function (hooks) {
assert.deepEqual(this.transitions, [['auth.two-fa', { queryParams: { token: 'two-fa-token' } }]]);
});
+ test('it says when a sign-up turned out to be an existing account', async function (assert) {
+ this.exchangeResult = () => Promise.resolve({ token: 'sanctum-token', type: 'user', existing_account: true });
+
+ await this.controller.start({ handoff: 'handoff-code' });
+
+ assert.deepEqual(this.notified.info, ['auth.login.oauth.existing-account']);
+ assert.deepEqual(this.manualTokens, ['sanctum-token']);
+ });
+
test('an ordinary sign-in says nothing about linking', async function (assert) {
await this.controller.start({ handoff: 'handoff-code' });
diff --git a/console/tests/unit/services/oauth-test.js b/console/tests/unit/services/oauth-test.js
index 6d64e399..61dbf517 100644
--- a/console/tests/unit/services/oauth-test.js
+++ b/console/tests/unit/services/oauth-test.js
@@ -34,6 +34,33 @@ module('Unit | Service | oauth', function (hooks) {
assert.true(service.isEnabled);
});
+ test('it offers sign-up buttons only when sign-ups are open', async function (assert) {
+ const service = this.owner.lookup('service:oauth');
+
+ this.getResult = () => Promise.resolve({ providers: [{ id: 'google', label: 'Google', icon: 'google' }], allow_registration: true });
+ await service.loadProviders();
+ assert.true(service.canSignUp);
+
+ this.getResult = () => Promise.resolve({ providers: [{ id: 'google', label: 'Google', icon: 'google' }], allow_registration: false });
+ await service.loadProviders();
+ assert.false(service.canSignUp, 'closed sign-ups hide them');
+
+ this.getResult = () => Promise.resolve({ providers: [], allow_registration: true });
+ await service.loadProviders();
+ assert.false(service.canSignUp, 'no provider, nothing to offer');
+ });
+
+ test('an api that does not say treats sign-ups as closed', async function (assert) {
+ this.getResult = () => Promise.resolve({ providers: [{ id: 'google', label: 'Google', icon: 'google' }] });
+ const service = this.owner.lookup('service:oauth');
+
+ await service.loadProviders();
+
+ // An older API: the login page still offers the provider, the sign-up page doesn't.
+ assert.true(service.isEnabled);
+ assert.false(service.canSignUp);
+ });
+
test('an unreachable endpoint leaves sign-in working without oauth', async function (assert) {
this.getResult = () => Promise.reject(new Error('network down'));
const service = this.owner.lookup('service:oauth');
diff --git a/console/translations/ar-ae.yaml b/console/translations/ar-ae.yaml
index 5c7b3a90..2a4cf9c5 100644
--- a/console/translations/ar-ae.yaml
+++ b/console/translations/ar-ae.yaml
@@ -584,6 +584,7 @@ auth:
unlink-body: 'لن تتمكن بعد الآن من تسجيل الدخول عبر {provider}. يمكنك ربطه مجددًا لاحقًا.'
linked: 'تم ربط المزوّد بحسابك.'
auto-linked: 'تم ربط {provider} بحسابك. يمكنك تسجيل الدخول به من الآن فصاعدًا.'
+ existing-account: 'لديك حساب بالفعل، لذا سجّلنا دخولك.'
unlinked: 'تم إلغاء ربط {provider}.'
errors:
generic: 'تعذّر إكمال تسجيل الدخول. يرجى المحاولة مرة أخرى.'
@@ -771,6 +772,7 @@ onboard:
confirm-password: تأكيد كلمة المرور
confirm-password-help-text: فقط لتأكيد كلمة المرور التي أدخلتها أعلاه.
oauth-verified: 'تم التحقق من هويتك. لا حاجة إلى كلمة مرور — ستسجّل الدخول عبر مزوّدك.'
+ oauth-divider: 'أو سجّل باستخدام البريد الإلكتروني'
continue-button-text: متابعة
verify-email:
header-title: التحقق من الحساب
diff --git a/console/translations/bg-bg.yaml b/console/translations/bg-bg.yaml
index ae03bcd0..fd209264 100644
--- a/console/translations/bg-bg.yaml
+++ b/console/translations/bg-bg.yaml
@@ -591,6 +591,7 @@ auth:
unlink-body: 'Вече няма да можете да влизате чрез {provider}. Можете да го свържете отново по-късно.'
linked: 'Доставчикът е свързан с профила ви.'
auto-linked: '{provider} вече е свързан с профила ви. Отсега нататък можете да влизате с него.'
+ existing-account: 'Вече имате профил, затова ви вписахме.'
unlinked: '{provider} е прекъснат.'
errors:
generic: 'Влизането не можа да бъде завършено. Опитайте отново.'
@@ -782,6 +783,7 @@ onboard:
confirm-password-help-text: Просто за да потвърдите паролата, която въведохте
по-горе.
oauth-verified: 'Самоличността ви е потвърдена. Не е нужна парола — ще влизате чрез своя доставчик.'
+ oauth-divider: 'Или се регистрирайте с имейл'
continue-button-text: Продължи
verify-email:
header-title: Потвърждение на акаунта
diff --git a/console/translations/de-de.yaml b/console/translations/de-de.yaml
index e03f9893..d57ad295 100644
--- a/console/translations/de-de.yaml
+++ b/console/translations/de-de.yaml
@@ -620,6 +620,7 @@ auth:
unlink-body: 'Sie können sich dann nicht mehr über {provider} anmelden. Sie können ihn später erneut verknüpfen.'
linked: 'Anbieter mit Ihrem Konto verknüpft.'
auto-linked: '{provider} ist jetzt mit Ihrem Konto verknüpft. Sie können sich ab sofort damit anmelden.'
+ existing-account: 'Sie haben bereits ein Konto, daher haben wir Sie angemeldet.'
unlinked: '{provider} getrennt.'
errors:
generic: 'Die Anmeldung konnte nicht abgeschlossen werden. Bitte versuchen Sie es erneut.'
@@ -816,6 +817,7 @@ onboard:
confirm-password: Passwort bestätigen
confirm-password-help-text: Nur zur Bestätigung des oben eingegebenen Passworts.
oauth-verified: 'Ihre Identität ist bestätigt. Kein Passwort nötig – Sie melden sich über Ihren Anbieter an.'
+ oauth-divider: 'Oder mit E-Mail registrieren'
continue-button-text: Fortfahren
verify-email:
header-title: Kontoverifizierung
diff --git a/console/translations/en-us.yaml b/console/translations/en-us.yaml
index a0d175fe..fb5ea141 100644
--- a/console/translations/en-us.yaml
+++ b/console/translations/en-us.yaml
@@ -631,6 +631,7 @@ auth:
unlink-body: 'You will no longer be able to sign in with {provider}. You can link it again later.'
linked: 'Provider linked to your account.'
auto-linked: '{provider} is now linked to your account. You can sign in with it from now on.'
+ existing-account: 'You already have an account, so we signed you in.'
unlinked: '{provider} unlinked.'
errors:
generic: 'We could not complete that sign-in. Please try again.'
@@ -857,6 +858,7 @@ onboard:
confirm-password: Confirm your password
confirm-password-help-text: Just to confirm the password you entered above.
oauth-verified: 'Your identity is verified. No password needed — you''ll sign in with your provider.'
+ oauth-divider: 'Or sign up with email'
continue-button-text: Continue
verify-email:
header-title: Account Verification
diff --git a/console/translations/es-es.yaml b/console/translations/es-es.yaml
index bc316e2d..01751b40 100644
--- a/console/translations/es-es.yaml
+++ b/console/translations/es-es.yaml
@@ -593,6 +593,7 @@ auth:
unlink-body: 'Ya no podrá iniciar sesión con {provider}. Puede volver a vincularlo más adelante.'
linked: 'Proveedor vinculado a su cuenta.'
auto-linked: '{provider} ya está vinculado a su cuenta. A partir de ahora puede iniciar sesión con él.'
+ existing-account: 'Ya tiene una cuenta, así que hemos iniciado su sesión.'
unlinked: '{provider} desvinculado.'
errors:
generic: 'No se pudo completar el inicio de sesión. Inténtelo de nuevo.'
@@ -785,6 +786,7 @@ onboard:
confirm-password-help-text: Solo para confirmar la contraseña que introdujiste
arriba.
oauth-verified: 'Su identidad está verificada. No necesita contraseña: iniciará sesión con su proveedor.'
+ oauth-divider: 'O regístrese con su correo'
continue-button-text: Continuar
verify-email:
header-title: Verificación de cuenta
diff --git a/console/translations/es-mx.yaml b/console/translations/es-mx.yaml
index 19835162..e4fe110c 100644
--- a/console/translations/es-mx.yaml
+++ b/console/translations/es-mx.yaml
@@ -623,6 +623,7 @@ auth:
unlink-body: 'Ya no podrás iniciar sesión con {provider}. Puedes volver a vincularlo más adelante.'
linked: 'Proveedor vinculado a tu cuenta.'
auto-linked: '{provider} ya está vinculado a tu cuenta. A partir de ahora puedes iniciar sesión con él.'
+ existing-account: 'Ya tienes una cuenta, así que iniciamos tu sesión.'
unlinked: '{provider} desvinculado.'
errors:
generic: 'No se pudo completar el inicio de sesión. Inténtalo de nuevo.'
@@ -831,6 +832,7 @@ onboard:
confirm-password-help-text: Solo para confirmar la contraseña que introdujiste
arriba.
oauth-verified: 'Tu identidad está verificada. No necesitas contraseña: iniciarás sesión con tu proveedor.'
+ oauth-divider: 'O regístrate con tu correo'
continue-button-text: Continuar
verify-email:
diff --git a/console/translations/fa-ir.yaml b/console/translations/fa-ir.yaml
index 65379aed..969fb61a 100644
--- a/console/translations/fa-ir.yaml
+++ b/console/translations/fa-ir.yaml
@@ -575,6 +575,7 @@ auth:
unlink-body: 'دیگر نمی‌توانید با {provider} وارد شوید. بعداً می‌توانید دوباره آن را متصل کنید.'
linked: 'ارائه‌دهنده به حساب شما متصل شد.'
auto-linked: '{provider} اکنون به حساب شما متصل است. از این پس می‌توانید با آن وارد شوید.'
+ existing-account: 'شما از قبل حساب دارید، بنابراین وارد حسابتان شدید.'
unlinked: 'اتصال {provider} قطع شد.'
errors:
generic: 'ورود کامل نشد. لطفاً دوباره تلاش کنید.'
@@ -759,6 +760,7 @@ onboard:
confirm-password: رمز عبور خود را تأیید کنید
confirm-password-help-text: فقط برای تأیید رمز عبوری که در بالا وارد کرده‌اید
oauth-verified: 'هویت شما تأیید شد. نیازی به رمز عبور نیست — با ارائه‌دهنده خود وارد می‌شوید.'
+ oauth-divider: 'یا با ایمیل ثبت‌نام کنید'
continue-button-text: ادامه
verify-email:
header-title: تأیید حساب
diff --git a/console/translations/fr-fr.yaml b/console/translations/fr-fr.yaml
index 03b04a84..690a54c3 100644
--- a/console/translations/fr-fr.yaml
+++ b/console/translations/fr-fr.yaml
@@ -594,6 +594,7 @@ auth:
unlink-body: 'Vous ne pourrez plus vous connecter avec {provider}. Vous pourrez l''associer à nouveau plus tard.'
linked: 'Fournisseur associé à votre compte.'
auto-linked: '{provider} est maintenant associé à votre compte. Vous pouvez désormais vous connecter avec.'
+ existing-account: 'Vous avez déjà un compte, nous vous avons donc connecté.'
unlinked: '{provider} dissocié.'
errors:
generic: 'La connexion n''a pas pu être finalisée. Veuillez réessayer.'
@@ -788,6 +789,7 @@ onboard:
confirm-password-help-text: Juste pour confirmer le mot de passe que vous avez
saisi ci-dessus.
oauth-verified: 'Votre identité est vérifiée. Aucun mot de passe nécessaire : vous vous connecterez via votre fournisseur.'
+ oauth-divider: 'Ou inscrivez-vous avec votre e-mail'
continue-button-text: Continuer
verify-email:
header-title: Vérification du compte
diff --git a/console/translations/it-it.yaml b/console/translations/it-it.yaml
index 43f2f6f2..b75f1b94 100644
--- a/console/translations/it-it.yaml
+++ b/console/translations/it-it.yaml
@@ -629,6 +629,7 @@ auth:
unlink-body: 'Non potrai più accedere con {provider}. Potrai collegarlo di nuovo in seguito.'
linked: 'Provider collegato al tuo account.'
auto-linked: '{provider} è ora collegato al tuo account. D’ora in poi puoi accedere con esso.'
+ existing-account: 'Hai già un account, quindi ti abbiamo fatto accedere.'
unlinked: '{provider} scollegato.'
errors:
generic: 'Non è stato possibile completare l''accesso. Riprova.'
@@ -813,6 +814,7 @@ onboard:
confirm-password: Conferma la tua password
confirm-password-help-text: Solo per confermare la password inserita sopra.
oauth-verified: 'La tua identità è verificata. Nessuna password necessaria: accederai con il tuo provider.'
+ oauth-divider: 'Oppure registrati con l’email'
continue-button-text: Continua
verify-email:
header-title: Verifica dell'account
diff --git a/console/translations/mn-mn.yaml b/console/translations/mn-mn.yaml
index e6a07c8d..3083174b 100644
--- a/console/translations/mn-mn.yaml
+++ b/console/translations/mn-mn.yaml
@@ -592,6 +592,7 @@ auth:
unlink-body: 'Та цаашид {provider}-ээр нэвтрэх боломжгүй болно. Дараа нь дахин холбож болно.'
linked: 'Үйлчилгээ таны бүртгэлд холбогдлоо.'
auto-linked: '{provider} таны бүртгэлд холбогдлоо. Одооноос түүгээр нэвтэрч болно.'
+ existing-account: 'Та аль хэдийн бүртгэлтэй тул бид таныг нэвтрүүллээ.'
unlinked: '{provider} салгагдлаа.'
errors:
generic: 'Нэвтрэлтийг гүйцэтгэж чадсангүй. Дахин оролдоно уу.'
@@ -785,6 +786,7 @@ onboard:
confirm-password: Нууц үгээ баталгаажуулах
confirm-password-help-text: Дээр оруулсан нууц үгийг баталгаажуулах зорилгоор.
oauth-verified: 'Таны бүртгэл баталгаажлаа. Нууц үг шаардлагагүй — та үйлчилгээгээрээ нэвтэрнэ.'
+ oauth-divider: 'Эсвэл имэйлээр бүртгүүлэх'
continue-button-text: Үргэлжлүүлэх
verify-email:
header-title: Бүртгэлийн баталгаажуулалт
diff --git a/console/translations/pt-br.yaml b/console/translations/pt-br.yaml
index cdce8a7a..b8a481ac 100644
--- a/console/translations/pt-br.yaml
+++ b/console/translations/pt-br.yaml
@@ -589,6 +589,7 @@ auth:
unlink-body: 'Você não poderá mais entrar com {provider}. Você pode conectá-lo novamente depois.'
linked: 'Provedor conectado à sua conta.'
auto-linked: '{provider} agora está conectado à sua conta. A partir de agora você pode entrar com ele.'
+ existing-account: 'Você já tem uma conta, então fizemos seu login.'
unlinked: '{provider} desconectado.'
errors:
generic: 'Não foi possível concluir o login. Tente novamente.'
@@ -779,6 +780,7 @@ onboard:
confirm-password: Confirme sua senha
confirm-password-help-text: Apenas para confirmar a senha que você digitou acima.
oauth-verified: 'Sua identidade foi verificada. Não é necessária senha — você entrará com seu provedor.'
+ oauth-divider: 'Ou cadastre-se com e-mail'
continue-button-text: Continuar
verify-email:
header-title: Verificação de Conta
diff --git a/console/translations/ru-ru.yaml b/console/translations/ru-ru.yaml
index af0822d1..24c23b4b 100644
--- a/console/translations/ru-ru.yaml
+++ b/console/translations/ru-ru.yaml
@@ -590,6 +590,7 @@ auth:
unlink-body: 'Вы больше не сможете входить через {provider}. Позже его можно привязать снова.'
linked: 'Поставщик привязан к вашей учётной записи.'
auto-linked: '{provider} теперь привязан к вашей учётной записи. Теперь вы можете входить через него.'
+ existing-account: 'У вас уже есть учётная запись, поэтому мы выполнили вход.'
unlinked: '{provider} отвязан.'
errors:
generic: 'Не удалось завершить вход. Попробуйте ещё раз.'
@@ -781,6 +782,7 @@ onboard:
confirm-password: Подтвердите пароль
confirm-password-help-text: Просто подтвердите пароль, который вы ввели выше.
oauth-verified: 'Ваша личность подтверждена. Пароль не нужен — вы будете входить через своего поставщика.'
+ oauth-divider: 'Или зарегистрируйтесь по электронной почте'
continue-button-text: Продолжить
verify-email:
header-title: Подтверждение аккаунта
diff --git a/console/translations/uz-uz.yaml b/console/translations/uz-uz.yaml
index 0e084b95..21bd5316 100644
--- a/console/translations/uz-uz.yaml
+++ b/console/translations/uz-uz.yaml
@@ -604,6 +604,7 @@ auth:
unlink-body: 'Endi {provider} orqali kira olmaysiz. Keyinroq uni qayta bog‘lashingiz mumkin.'
linked: 'Provayder hisobingizga bog‘landi.'
auto-linked: '{provider} endi hisobingizga bog‘landi. Bundan buyon u orqali kirishingiz mumkin.'
+ existing-account: 'Sizda allaqachon hisob bor, shuning uchun tizimga kiritdik.'
unlinked: '{provider} uzildi.'
errors:
generic: 'Kirishni yakunlab bo‘lmadi. Qaytadan urinib ko‘ring.'
@@ -793,6 +794,7 @@ onboard:
confirm-password: Parolingizni tasdiqlang
confirm-password-help-text: Yuqorida kiritgan parolingizni tasdiqlash uchun.
oauth-verified: 'Shaxsingiz tasdiqlandi. Parol kerak emas — provayderingiz orqali kirasiz.'
+ oauth-divider: 'Yoki elektron pochta orqali roʻyxatdan oʻting'
continue-button-text: Davom etish
verify-email:
header-title: Hisobni tekshirish
diff --git a/console/translations/vi-vn.yaml b/console/translations/vi-vn.yaml
index 407ace6f..27dff20a 100644
--- a/console/translations/vi-vn.yaml
+++ b/console/translations/vi-vn.yaml
@@ -593,6 +593,7 @@ auth:
unlink-body: 'Bạn sẽ không thể đăng nhập bằng {provider} nữa. Bạn có thể liên kết lại sau.'
linked: 'Đã liên kết nhà cung cấp với tài khoản của bạn.'
auto-linked: '{provider} đã được liên kết với tài khoản của bạn. Từ nay bạn có thể đăng nhập bằng nó.'
+ existing-account: 'Bạn đã có tài khoản nên chúng tôi đã đăng nhập cho bạn.'
unlinked: 'Đã hủy liên kết {provider}.'
errors:
generic: 'Không thể hoàn tất đăng nhập. Vui lòng thử lại.'
@@ -784,6 +785,7 @@ onboard:
confirm-password: Xác nhận mật khẩu
confirm-password-help-text: Chỉ để xác nhận mật khẩu bạn đã nhập ở trên.
oauth-verified: 'Danh tính của bạn đã được xác minh. Không cần mật khẩu — bạn sẽ đăng nhập bằng nhà cung cấp.'
+ oauth-divider: 'Hoặc đăng ký bằng email'
continue-button-text: Tiếp tục
verify-email:
header-title: Xác minh tài khoản
diff --git a/console/translations/zh-cn.yaml b/console/translations/zh-cn.yaml
index ee5c1137..162856fd 100644
--- a/console/translations/zh-cn.yaml
+++ b/console/translations/zh-cn.yaml
@@ -568,6 +568,7 @@ auth:
unlink-body: '您将无法再使用 {provider} 登录。之后可以重新关联。'
linked: '已将登录方式关联到您的账户。'
auto-linked: '{provider} 已关联到您的账户。今后您可以使用它登录。'
+ existing-account: '您已有账户,我们已为您登录。'
unlinked: '已取消关联 {provider}。'
errors:
generic: '无法完成登录,请重试。'
@@ -752,6 +753,7 @@ onboard:
confirm-password: 确认密码
confirm-password-help-text: 确认您上面输入的密码。
oauth-verified: '您的身份已验证。无需密码,您将使用该登录方式登录。'
+ oauth-divider: '或使用电子邮件注册'
continue-button-text: 继续
verify-email:
header-title: 账户验证