parent
7448f0e392
commit
0d49ad92df
@ -66,10 +66,6 @@ export default Component.extend(DEFAULTS, {
|
|||||||
selectedAuth: newMethod,
|
selectedAuth: newMethod,
|
||||||
oldSelectedAuth: oldMethod,
|
oldSelectedAuth: oldMethod,
|
||||||
} = this;
|
} = this;
|
||||||
// if we are cancelling the login then we reset the number challenge answer and cancel the current authenticate and polling tasks
|
|
||||||
if (cancelAuth) {
|
|
||||||
this.authenticate.cancelAll();
|
|
||||||
}
|
|
||||||
next(() => {
|
next(() => {
|
||||||
if (!token && (oldNS === null || oldNS !== ns)) {
|
if (!token && (oldNS === null || oldNS !== ns)) {
|
||||||
this.fetchMethods.perform();
|
this.fetchMethods.perform();
|
||||||
|
@ -88,8 +88,5 @@ export default Controller.extend({
|
|||||||
mfaErrors: null,
|
mfaErrors: null,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancelAuthentication() {
|
|
||||||
this.set('cancelAuth', true);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Model, { attr } from '@ember-data/model';
|
import Model, { attr } from '@ember-data/model';
|
||||||
import parseURL from 'core/utils/parse-url';
|
|
||||||
|
|
||||||
const DOMAIN_STRINGS = {
|
const DOMAIN_STRINGS = {
|
||||||
};
|
};
|
||||||
@ -17,13 +16,6 @@ export default class RoleJwtModel extends Model {
|
|||||||
@attr('string') authUrl;
|
@attr('string') authUrl;
|
||||||
|
|
||||||
get providerName() {
|
get providerName() {
|
||||||
const { hostname } = parseURL(this.authUrl);
|
return null;
|
||||||
const firstMatch = Object.keys(DOMAIN_STRINGS).find((name) => hostname.includes(name));
|
|
||||||
return DOMAIN_STRINGS[firstMatch] || null;
|
|
||||||
}
|
|
||||||
|
|
||||||
get providerButtonComponent() {
|
|
||||||
const { providerName } = this;
|
|
||||||
return PROVIDER_WITH_LOGO.includes(providerName) ? `auth-button-${providerName.toLowerCase()}` : null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,12 +54,8 @@
|
|||||||
id="auth-submit"
|
id="auth-submit"
|
||||||
>
|
>
|
||||||
{{#if this.isOIDC}}
|
{{#if this.isOIDC}}
|
||||||
{{#if this.role.providerButtonComponent}}
|
|
||||||
{{component this.role.providerButtonComponent}}
|
|
||||||
{{else}}
|
|
||||||
Sign in with
|
Sign in with
|
||||||
{{or this.role.providerName "OIDC Provider"}}
|
{{or this.role.providerName "OIDC Provider"}}
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
Sign In
|
Sign In
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -116,6 +116,15 @@
|
|||||||
@onSuccess={{action "onMfaSuccess"}}
|
@onSuccess={{action "onMfaSuccess"}}
|
||||||
@onError={{fn (mut this.mfaErrors)}}
|
@onError={{fn (mut this.mfaErrors)}}
|
||||||
/>
|
/>
|
||||||
|
{{else}}
|
||||||
|
<AuthForm
|
||||||
|
@wrappedToken={{this.wrappedToken}}
|
||||||
|
@cluster={{this.model}}
|
||||||
|
@namespace={{this.namespaceQueryParam}}
|
||||||
|
@redirectTo={{this.redirectTo}}
|
||||||
|
@selectedAuth={{this.authMethod}}
|
||||||
|
@onSuccess={{action "onAuthResponse"}}
|
||||||
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</Page.content>
|
</Page.content>
|
||||||
<Page.footer>
|
<Page.footer>
|
||||||
|
Loading…
Reference in New Issue
Block a user