diff --git a/ui/app/components/auth-form.js b/ui/app/components/auth-form.js index eda85747193a..11b1ae2cfede 100644 --- a/ui/app/components/auth-form.js +++ b/ui/app/components/auth-form.js @@ -173,7 +173,7 @@ export default Component.extend(DEFAULTS, { showLoading: or('isLoading', 'authenticate.isRunning', 'fetchMethods.isRunning', 'unwrapToken.isRunning'), - handleError(e) { + handleError(e, prefixMessage = true) { this.set('loading', false); if (!e.errors) { return e; @@ -184,7 +184,8 @@ export default Component.extend(DEFAULTS, { } return error; }); - this.set('error', `Authentication failed: ${errors.join('.')}`); + let message = prefixMessage ? 'Authentication failed: ' : ''; + this.set('error', `${message}${errors.join('.')}`); }, authenticate: task(function*(backendType, data) { @@ -239,5 +240,12 @@ export default Component.extend(DEFAULTS, { } return this.authenticate.unlinked().perform(backend.type, data); }, + handleError(e) { + if (e) { + this.handleError(e, false); + } else { + this.set('error', null); + } + }, }, }); diff --git a/ui/app/templates/components/auth-form.hbs b/ui/app/templates/components/auth-form.hbs index 22ca15e94622..8d1f204d3958 100644 --- a/ui/app/templates/components/auth-form.hbs +++ b/ui/app/templates/components/auth-form.hbs @@ -56,7 +56,7 @@ {{/if}} {{#if (or (eq this.selectedAuthBackend.type "jwt") (eq this.selectedAuthBackend.type "oidc"))}}