Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Jan 30, 2018
1 parent 93255d5 commit edaa75d
Showing 1 changed file with 21 additions and 54 deletions.
75 changes: 21 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Install with npm:
npm install @nuxtjs/auth @nuxtjs/axios
```

Edit `nuxt.js.config`:
Edit `nuxt.config.js`:

```js
{
Expand All @@ -56,6 +56,7 @@ Edit `nuxt.js.config`:
}
```
See [Options](#options) section for all available options
<h2 align="center">Auth Middleware</h2>
Expand All @@ -82,88 +83,54 @@ export default {
<h2 align="center">Options</h2>
Check out [this](lib/defaults.js) file for default options.
### `user`
Sets the global settings for store **fetch** action.
`endpoint`
Set the URL of the user data endpoint. It can be a relative or absolute path.
`propertyName`
Set the name of the return object property that contains the user data. If you want the entire object returned, set an empty string.
`resetOnFail`
`endpoint` - Set the URL of the user data endpoint. It can be a relative or absolute path.
- Default: `true`
`propertyName` - Set the name of the return object property that contains the user data. If you want the entire object returned, set an empty string.
Automatically invalidate all tokens if user fetch fails.
`resetOnFail` - Automatically invalidate all tokens if user fetch fails.
`method`
Set the request to POST or GET.
`method` - Set the request to POST or GET.
### `login`
Set the global settings for store **login** action.
`endpoint`
Set the URL of the login endpoint. It can be a relative or absolute path.
`endpoint` - Set the URL of the login endpoint. It can be a relative or absolute path.
### `logout`
Sets the global settings for store **logout** action.
`endpoint`
Set the URL of the logout endpoint. It can be a relative or absolute path.
`endpoint` - Set the URL of the logout endpoint. It can be a relative or absolute path.
`method`
Set the request to POST or GET.
`method` - Set the request to POST or GET.
### `token`
`enabled`
Get and use tokens for authentication.
`enabled` - Get and use tokens for authentication.
`type`
`type` - Sets the token type of the authorization header.
Sets the token type of the authorization header.
`localStorage` - If set to `true`, Keeps token in local storage.
`localStorage`
`name` - Set the token name in the local storage.
If set to `true`, Keeps token in local storage.
`cookie` - Keeps token in cookies, if enabled.
`name`
Set the token name in the local storage.
`cookie`
Keeps token in cookies, if enabled.
`cookieName`
Set the token name in Cookies.
`cookieName` - Set the token name in Cookies.
### `redirect`
`guest`
Sets if the middleware should redirect guests users (unauthenticated). Only when `auth` middleware is added to a page.
`user`
Sets if the middleware should redirect logged users (authenticated). Only when `auth` middleware is added to a page.
`notLoggedIn`
`guest` - Sets if the middleware should redirect guests users (unauthenticated). Only when `auth` middleware is added to a page.
Sets the redirect URL default of the users not logged in. Only when `auth` middleware is added to a page.
`user` - Sets if the middleware should redirect logged users (authenticated). Only when `auth` middleware is added to a page.
`loggedIn`
`notLoggedIn` - Sets the redirect URL default of the users not logged in. Only when `auth` middleware is added to a page.
Sets the redirect URL default of the users logged in. Only when `auth` middleware is added to a page.
`loggedIn` - Sets the redirect URL default of the users logged in. Only when `auth` middleware is added to a page.
### `errorHandler`
Expand Down

0 comments on commit edaa75d

Please sign in to comment.