Skip to content

Commit c86449b

Browse files
author
Noelle Daley
authored
ui/provide otp (#8630) (#8642)
* show OTP if there is one, otherwise show placeholder * show OTP during first step of token generation process * use let instead of with
1 parent a00c97f commit c86449b

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

ui/app/templates/components/shamir-flow.hbs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
<HoverCopyButton @copyValue={{encoded_token}} />
55
<div class="message-body">
66
<h4 class="title is-7 is-marginless">
7-
{{#if otp}}
8-
Encoded Operation Token
9-
{{else}}
10-
Encrypted Operation Token
11-
{{/if}}
7+
Encoded Operation Token
128
</h4>
139
<code class="is-word-break">{{encoded_token}}</code>
1410
</div>
@@ -23,10 +19,10 @@
2319
<code class="is-word-break">{{otp}}</code>
2420
</div>
2521
</div>
22+
{{/if}}
2623
<div class="message is-list has-copy-button" tabindex="-1">
27-
{{#let
28-
(concat 'vault operator generate-root -dr-token -otp="' otp '" -decode="' encoded_token '"')
29-
as |cmd|}}
24+
{{#let (if otp
25+
(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|}}
3026
<HoverCopyButton @copyValue={{cmd}} />
3127
<div class="message-body">
3228
<h4 class="title is-7 is-marginless">
@@ -36,7 +32,6 @@
3632
</div>
3733
{{/let}}
3834
</div>
39-
{{/if}}
4035
</div>
4136
<div class="box is-marginless is-shadowless">
4237
<button type="button" class="button" {{action 'reset'}}>
@@ -131,6 +126,20 @@
131126
</div>
132127
{{/if}}
133128
<div class="box is-shadowless is-marginless no-padding-top is-fullwidth" data-test-form-text>
129+
{{#if otp}}
130+
<p>
131+
<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." />
132+
</p>
133+
<div class="message is-list has-copy-button" tabindex="-1">
134+
<HoverCopyButton @copyValue={{otp}} />
135+
<div class="message-body">
136+
<h4 class="title is-7 is-marginless">
137+
One Time Password (otp)
138+
</h4>
139+
<code class="is-word-break">{{otp}}</code>
140+
</div>
141+
</div>
142+
{{/if}}
134143
{{#if (has-block)}}
135144
{{yield}}
136145
{{else if formText}}

0 commit comments

Comments
 (0)