parent
7448f0e392
commit
0d49ad92df
|
@ -66,10 +66,6 @@ export default Component.extend(DEFAULTS, {
|
|||
selectedAuth: newMethod,
|
||||
oldSelectedAuth: oldMethod,
|
||||
} = 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(() => {
|
||||
if (!token && (oldNS === null || oldNS !== ns)) {
|
||||
this.fetchMethods.perform();
|
||||
|
|
|
@ -88,8 +88,5 @@ export default Controller.extend({
|
|||
mfaErrors: null,
|
||||
});
|
||||
},
|
||||
cancelAuthentication() {
|
||||
this.set('cancelAuth', true);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
*/
|
||||
|
||||
import Model, { attr } from '@ember-data/model';
|
||||
import parseURL from 'core/utils/parse-url';
|
||||
|
||||
const DOMAIN_STRINGS = {
|
||||
};
|
||||
|
@ -17,13 +16,6 @@ export default class RoleJwtModel extends Model {
|
|||
@attr('string') authUrl;
|
||||
|
||||
get providerName() {
|
||||
const { hostname } = parseURL(this.authUrl);
|
||||
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;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,12 +54,8 @@
|
|||
id="auth-submit"
|
||||
>
|
||||
{{#if this.isOIDC}}
|
||||
{{#if this.role.providerButtonComponent}}
|
||||
{{component this.role.providerButtonComponent}}
|
||||
{{else}}
|
||||
Sign in with
|
||||
{{or this.role.providerName "OIDC Provider"}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
Sign In
|
||||
{{/if}}
|
||||
|
|
|
@ -116,6 +116,15 @@
|
|||
@onSuccess={{action "onMfaSuccess"}}
|
||||
@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}}
|
||||
</Page.content>
|
||||
<Page.footer>
|
||||
|
|
Loading…
Reference in New Issue
Block a user