{{!
  Copyright IBM Corp. 2016, 2025
  SPDX-License-Identifier: BUSL-1.1
}}

{{#if this.unwrapTokenError}}
  <div class="flex is-flex-grow-1">
    <Hds::ApplicationState @align="center" class="align-self-center" data-test-page-error as |A|>
      <A.Header @title="Authentication error" @titleTag="h1" data-test-empty-state-title />
      <A.Body @text="Token unwrap failed" data-test-empty-state-message />
      <A.Body @text="Error: {{this.unwrapTokenError}}" />
      <A.Footer data-test-empty-state-actions as |F|>
        <F.Button @icon="arrow-left" @color="tertiary" @text="Go back" {{on "click" (action "backToLogin")}} />
      </A.Footer>
    </Hds::ApplicationState>
  </div>
{{else}}
  <Auth::Page
    @cluster={{this.model.clusterModel}}
    @directLinkData={{this.model.directLinkData}}
    @loginAndTransition={{this.loginAndTransition}}
    @loginSettings={{this.model.loginSettings}}
    @namespaceQueryParam={{this.namespaceQueryParam}}
    @oidcProviderQueryParam={{this.oidcProvider}}
    @onNamespaceUpdate={{perform this.updateNamespace}}
    @roleQueryParam={{this.role}}
    @shouldRefocusNamespaceInput={{this.shouldRefocusNamespaceInput}}
    @visibleAuthMounts={{this.model.visibleAuthMounts}}
  />
{{/if}}