Skip to content

Commit

Permalink
馃摑 Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
epilande committed Jul 29, 2019
1 parent 08ed06b commit 2bced2c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions gatsby-theme-auth0/README.md
Expand Up @@ -47,6 +47,27 @@ module.exports = {
};
```

Set up your login/logout buttons and you're good to go!

```jsx
import React from "react";
import { AuthService, useAuth } from "gatsby-theme-auth0";

export default () => {
const { isLoggedIn, profile } = useAuth();
return (
<div>
{profile && <p>Hello {profile.name}</p>}
{isLoggedIn ? (
<button onClick={AuthService.logout}>Logout</button>
) : (
<button onClick={AuthService.login}>Login</button>
)}
</div>
);
};
```

### Theme options

| Key | Default | Required | Description |
Expand Down

0 comments on commit 2bced2c

Please sign in to comment.