Skip to content

Commit

Permalink
ui/provide otp (#8630)
Browse files Browse the repository at this point in the history
* show OTP if there is one, otherwise show placeholder

* show OTP during first step of token generation process

* use let instead of with
  • Loading branch information
Noelle Daley authored Mar 31, 2020
1 parent 13bd315 commit 061bc8e
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions ui/app/templates/components/shamir-flow.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
<HoverCopyButton @copyValue={{encoded_token}} />
<div class="message-body">
<h4 class="title is-7 is-marginless">
{{#if otp}}
Encoded Operation Token
{{else}}
Encrypted Operation Token
{{/if}}
Encoded Operation Token
</h4>
<code class="is-word-break">{{encoded_token}}</code>
</div>
Expand All @@ -23,10 +19,10 @@
<code class="is-word-break">{{otp}}</code>
</div>
</div>
{{/if}}
<div class="message is-list has-copy-button" tabindex="-1">
{{#let
(concat 'vault operator generate-root -dr-token -otp="' otp '" -decode="' encoded_token '"')
as |cmd|}}
{{#let (if otp
(concat 'vault operator generate-root -otp="' otp '" -decode="' encoded_token '"') (concat 'vault operator generate-root -otp="<enter your otp here>" -decode="' encoded_token '"') ) as |cmd|}}
<HoverCopyButton @copyValue={{cmd}} />
<div class="message-body">
<h4 class="title is-7 is-marginless">
Expand All @@ -36,7 +32,6 @@
</div>
{{/let}}
</div>
{{/if}}
</div>
<div class="box is-marginless is-shadowless">
<button type="button" class="button" {{action 'reset'}}>
Expand Down Expand Up @@ -131,6 +126,20 @@
</div>
{{/if}}
<div class="box is-shadowless is-marginless no-padding-top is-fullwidth" data-test-form-text>
{{#if otp}}
<p>
<AlertBanner @type="info" @message="Below is the generated OTP. This will be used to encode the generated Operation Token. Make sure to save this, as you will need it later to decode the Operation Token." />
</p>
<div class="message is-list has-copy-button" tabindex="-1">
<HoverCopyButton @copyValue={{otp}} />
<div class="message-body">
<h4 class="title is-7 is-marginless">
One Time Password (otp)
</h4>
<code class="is-word-break">{{otp}}</code>
</div>
</div>
{{/if}}
{{#if (has-block)}}
{{yield}}
{{else if formText}}
Expand Down

0 comments on commit 061bc8e

Please sign in to comment.