Skip to content

Commit

Permalink
Modify allSecurities block within CodeSampleResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
uppal101 committed Oct 27, 2017
1 parent 7e8870a commit e20642f
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions packages/api-explorer-ui/src/CodeSampleResponse.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,23 @@ class CodeSampleResponse extends React.Component {

{result.statusCode[0] === 401 && (
<div className="text-center hub-expired-token">
{allSecurities &&
(allSecurities.OAuth2[0].flows.implicit.authorizationUrl &&
<div>
<p>Your OAuth2 token has expired</p>
<a className="btn btn-primary" href="/oauth" target="_self">
Reauthenticate via OAuth2
</a>
</div>(<p> Your OAuth2 token is incorrect or has expired</p>))(
<p>You couldn't be authenticated</p>,
)}
{allSecurities.OAuth2 ? (
() => {
if (allSecurities.OAuth2[0].flows.implicit.authorizationUrl) {
return (
<div>
<p>Your OAuth2 token has expired</p>
<a className="btn btn-primary" href="/oauth" target="_self">
Reauthenticate via OAuth2
</a>
</div>
);
}
return <p> Your OAuth2 token is incorrect or has expired</p>;
}
) : (
<p> You couldn&apos;t be authenticated</p>
)}
</div>
)}
</div>
Expand Down

0 comments on commit e20642f

Please sign in to comment.