1
0
fixes de439ac5 and 7448f0e3
This commit is contained in:
Konstantin Demin 2024-07-01 23:16:56 +03:00
parent 7448f0e392
commit 0d49ad92df
5 changed files with 10 additions and 20 deletions

View File

@ -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();

View File

@ -88,8 +88,5 @@ export default Controller.extend({
mfaErrors: null,
});
},
cancelAuthentication() {
this.set('cancelAuth', true);
},
},
});

View File

@ -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;
}
}

View File

@ -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}}

View File

@ -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>