Skip to content

Commit

Permalink
Fix code examples in documentation: Add missing return statements and…
Browse files Browse the repository at this point in the history
… remove superfluous else/else-if statements (#32)
  • Loading branch information
jlndk authored Jun 6, 2024
1 parent b21d176 commit 65c3e3d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ export default function App() {
{JSON.stringify(result.id_token, null, 2)}
</pre>
)
} else {
}

return (
<React.Fragment>
{result?.error ? (
<p>
An error occured: {result.error} ({result.error_description}). Please try again:
An error occurred: {result.error} ({result.error_description}). Please try again.
</p>
) : null}
<AuthMethodSelector />
</React.Fragment>
}
);
}
```
Expand Down Expand Up @@ -112,13 +114,16 @@ export default function App() {
if (isLoading) {
return <div>Loading</div>
}
else if (claims) {

if (claims) {
return (
<pre>
{JSON.stringify(claims, null, 2)}
</pre>
)
} else {
}

return (
<React.Fragment>
{error ? (
<p>
Expand All @@ -127,13 +132,13 @@ export default function App() {
) : null}
<AuthMethodSelector />
</React.Fragment>
}
);
}
```
### Logging Out
`@criipto/verify-react` offers the logout method you can use to clear session storage and log out of any existing SSO session.
`@criipto/verify-react` offers the logout method you can use to clear session storage and log out of any existing SSO session.
```jsx
const {logout} = useCriiptoVerify();
Expand Down

0 comments on commit 65c3e3d

Please sign in to comment.