Skip to content

Commit 72af64d

Browse files
committed
check for session token before displaying copy opts
1 parent f46bee5 commit 72af64d

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

app/views/command-line.html

+13-11
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,25 @@ <h1 id="cli">Command Line Tools</h1>
3737
</p>
3838
<p>
3939
After downloading and installing it, you can start by logging in using<span ng-if="sessionToken"> this current session token</span>:
40-
<div class="code prettyprint ng-binding" ng-if="sessionToken">
41-
oc login {{loginBaseURL}} --token=<span ng-show="showSessionToken">{{sessionToken}}</span><span ng-show="!showSessionToken">&lt;hidden&gt;</span>
40+
<div ng-if="sessionToken">
41+
<div class="code prettyprint ng-binding">
42+
oc login {{loginBaseURL}} --token=<span ng-show="showSessionToken">{{sessionToken}}</span><span ng-show="!showSessionToken">&lt;hidden&gt;</span>
43+
</div>
44+
<a href="#" ng-click="toggleShowSessionToken()">
45+
<span ng-show="!showSessionToken">Show token</span>
46+
<span ng-show="showSessionToken">Hide token</span>
47+
</a>
48+
<span ng-if="!IS_IOS">
49+
<span class="action-divider">|</span>
50+
<copy-to-clipboard display-as-link="true" clipboard-text="'oc login ' + loginBaseURL + ' --token=' + sessionToken" custom-link-text="'Copy command to clipboard'"></copy-to-clipboard>
51+
</span>
4252
</div>
43-
<a href="#" ng-click="toggleShowSessionToken()">
44-
<span ng-show="!showSessionToken">Show token</span>
45-
<span ng-show="showSessionToken">Hide token</span>
46-
</a>
47-
<span ng-if="!IS_IOS">
48-
<span class="action-divider">|</span>
49-
<copy-to-clipboard display-as-link="true" clipboard-text="'oc login ' + loginBaseURL + ' --token=' + sessionToken" custom-link-text="'Copy command to clipboard'"></copy-to-clipboard>
50-
</span>
5153
<pre class="code prettyprint ng-binding" ng-if="!sessionToken">
5254
oc login {{loginBaseURL}}
5355
</pre>
5456
</p>
5557

56-
<div class="alert alert-warning">
58+
<div class="alert alert-warning" ng-if="sessionToken">
5759
<span class="pficon pficon-warning-triangle-o" aria-hidden="true"></span>
5860
<strong>A token is a form of a password.</strong>
5961
Do not share your API token.

dist/scripts/templates.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3871,7 +3871,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
38713871
"</p>\n" +
38723872
"<p>\n" +
38733873
"After downloading and installing it, you can start by logging in using<span ng-if=\"sessionToken\"> this current session token</span>:\n" +
3874-
"<div class=\"code prettyprint ng-binding\" ng-if=\"sessionToken\">\n" +
3874+
"<div ng-if=\"sessionToken\">\n" +
3875+
"<div class=\"code prettyprint ng-binding\">\n" +
38753876
"oc login {{loginBaseURL}} --token=<span ng-show=\"showSessionToken\">{{sessionToken}}</span><span ng-show=\"!showSessionToken\">&lt;hidden&gt;</span>\n" +
38763877
"</div>\n" +
38773878
"<a href=\"#\" ng-click=\"toggleShowSessionToken()\">\n" +
@@ -3882,11 +3883,12 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
38823883
"<span class=\"action-divider\">|</span>\n" +
38833884
"<copy-to-clipboard display-as-link=\"true\" clipboard-text=\"'oc login ' + loginBaseURL + ' --token=' + sessionToken\" custom-link-text=\"'Copy command to clipboard'\"></copy-to-clipboard>\n" +
38843885
"</span>\n" +
3886+
"</div>\n" +
38853887
"<pre class=\"code prettyprint ng-binding\" ng-if=\"!sessionToken\">\n" +
38863888
" oc login {{loginBaseURL}}\n" +
38873889
" </pre>\n" +
38883890
"</p>\n" +
3889-
"<div class=\"alert alert-warning\">\n" +
3891+
"<div class=\"alert alert-warning\" ng-if=\"sessionToken\">\n" +
38903892
"<span class=\"pficon pficon-warning-triangle-o\" aria-hidden=\"true\"></span>\n" +
38913893
"<strong>A token is a form of a password.</strong>\n" +
38923894
"Do not share your API token.\n" +

0 commit comments

Comments
 (0)