open-nomad/ui/app/templates/components/forbidden-message.hbs
Buck Doyle 6d67e90763
Add exchange of one-time token on UI load (#10066)
This adds UI support for receiving the one-time token passed via query parameter, as in #10134
and related PRs, and exchanging it for its corresponding secret ID. When this works, it’s mostly
invisible, with a brief flash of the OTT onscreen.

The authentication failure message now suggests the -authenticate flag.

When OTT exchange fails, it shows a whole-page error.

This includes a known UX shortcoming in that the OTT will not disappear from the URL when an
identifier is specified on the command line, like nomad ui -authenticate jobname. The goal is to
address that shortcoming in a forthcoming pull request.
2021-04-01 13:21:30 -05:00

29 lines
988 B
Handlebars

<div data-test-error class="empty-message">
<h3 data-test-error-title class="empty-message-headline">Not Authorized</h3>
<p data-test-error-message class="empty-message-body">
{{#if this.token.secret}}
Your <LinkTo @route="settings.tokens">ACL token</LinkTo> does not provide the
{{#if this.permission}}
<code>{{this.permission}}</code>
{{else}}
required
{{/if}}
permission. Contact your administrator if this is an error.
{{else}}
Provide an <LinkTo @route="settings.tokens">ACL token</LinkTo> with the
{{#if this.permission}}
<code>{{this.permission}}</code>
{{else}}
requisite
{{/if}}
permission to view this.
{{/if}}
</p>
<p class="empty-message-body">
If you have an ACL token configured for the CLI, authenticate with:
<div class='terminal-container'>
<pre class='terminal'><span class='prompt'>$</span> nomad ui -authenticate</pre>
</div>
</p>
</div>