Skip to content

Commit

Permalink
Updated default token instructions to reflect storage state
Browse files Browse the repository at this point in the history
  • Loading branch information
mluypaert committed Jan 9, 2024
1 parent 84aff72 commit 539a89d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions client/src/containers/Authenticate/TokenMgmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ function TokenMgmt() {
[authorizedFetch]
);

const defaultTokenInstructions =
const noTokenInstructions =
'No stored ID token to display.\n' +
"Click the 'Store token' button below to store the current ID token and display it here.";
const newTokenInstructions =
'Stored tokens can not be retrieved for display after storage.\n' +
"Click the 'Store token' button below to store a new token (invalidating the current stored token) and display it here.";

function storeTokenHandler() {
console.log('storeTokenHandler triggered.');
Expand Down Expand Up @@ -141,7 +144,13 @@ function TokenMgmt() {
<textarea
disabled={true}
style={{ width: '100%', height: 65 }}
value={tokenState.apiToken || defaultTokenInstructions}
value={
tokenState.apiToken
? tokenState.apiToken
: tokenMetaDataState['token-stored?']
? newTokenInstructions
: noTokenInstructions
}
/>
<CopyToClipboard text={tokenState.apiToken}>
<div>
Expand Down

0 comments on commit 539a89d

Please sign in to comment.