diff --git a/.changelog/19529.txt b/.changelog/19529.txt new file mode 100644 index 000000000..9e588a13f --- /dev/null +++ b/.changelog/19529.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Hide token secret upon successful login +``` diff --git a/ui/app/styles/components/authorization.scss b/ui/app/styles/components/authorization.scss index 08dc3b40a..c6f873bf5 100644 --- a/ui/app/styles/components/authorization.scss +++ b/ui/app/styles/components/authorization.scss @@ -24,6 +24,11 @@ margin-bottom: 1.5rem; } + .token-details { + display: grid; + gap: 1rem; + } + .or-divider { display: block; width: 100%; diff --git a/ui/app/templates/settings/tokens.hbs b/ui/app/templates/settings/tokens.hbs index ef43ed656..22473668b 100644 --- a/ui/app/templates/settings/tokens.hbs +++ b/ui/app/templates/settings/tokens.hbs @@ -8,167 +8,168 @@ {{#if this.isValidatingToken}} {{else}} -

- {{#if this.tokenRecord}} - Profile - {{else}} - Sign In - {{/if}} -

-
+ + + {{#if this.tokenRecord}} + Profile + {{else}} + Sign In + {{/if}} + + + {{#if this.shouldShowPolicies}} + {{#unless this.tokenRecord.isExpired}} + + + {{/unless}} + {{/if}} + + + +
{{#if (eq this.signInStatus "failure")}} -
-
-
-

Token Failed to Authenticate

-

The token secret you have provided does not match an existing token, or has expired.

-
-
-
+ + Token Failed to Authenticate + The token secret you have provided does not match an existing token, or has expired. + {{/if}} {{#if (eq this.signInStatus "jwtFailure")}} -
-
-
-

JWT Failed to Authenticate

-

You passed in a JWT, but no JWT auth methods were found

-
-
-
+ + JWT Failed to Authenticate + You passed in a JWT, but no JWT auth methods were found + {{/if}} {{#if this.tokenRecord.isExpired}} -
-
-
-

Your authentication has expired

-

Expired {{moment-from-now this.tokenRecord.expirationTime interval=1000}} ({{this.tokenRecord.expirationTime}})

-
-
- -
-
-
+ + Your authentication has expired + Expired {{moment-from-now this.tokenRecord.expirationTime interval=1000}} ({{this.tokenRecord.expirationTime}}) + {{else}} {{#if (eq this.signInStatus "success")}} -
-
-
-

Token Authenticated!

-

Your token is valid and authorized for the following policies.

-
-
-
+ + Token Authenticated! + Your token is valid and authorized for the following policies. + {{/if}} {{/if}} {{#if this.token.tokenNotFound}} -
-
-
-

Your token was not found

-

It may have expired, or been entered incorrectly.

-
-
-
+ + Token not found + It may have expired, or been entered incorrectly. + {{/if}} {{#if this.SSOFailure}} -
-
-
-

Failed to sign in with SSO

-

Your OIDC provider has failed on sign in; please try again or contact your SSO administrator.

-
-
- -
-
-
+ + Failed to sign in with SSO + Your OIDC provider has failed on sign in; please try again or contact your SSO administrator. + {{/if}}
-
- {{#if this.canSignIn}} - + {{/unless}} +
+ {{/if}} {{/if}} diff --git a/ui/tests/pages/settings/tokens.js b/ui/tests/pages/settings/tokens.js index aa3dace61..6164d16d9 100644 --- a/ui/tests/pages/settings/tokens.js +++ b/ui/tests/pages/settings/tokens.js @@ -24,7 +24,7 @@ export default create({ successMessage: isVisible('[data-test-token-success]'), managementMessage: isVisible('[data-test-token-management-message]'), ssoErrorMessage: isVisible('[data-test-sso-error]'), - clearSSOError: clickable('[data-test-sso-error-clear]'), + clearSSOError: clickable('[data-test-sso-error] .hds-dismiss-button'), policies: collection('[data-test-token-policy]', { name: text('[data-test-policy-name]'),