Skip to content

Commit 4df8fa7

Browse files
authored
Added auth 'userService' option example
I had a hard time finding this option in the documentation, I actually had to read the source code to find it out, so it made sense to me to add an example.
1 parent f873413 commit 4df8fa7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,20 @@ const feathersClient = feathers()
547547
### Configuration
548548
You can provide a `userService` in the auth plugin's options to automatically populate the user upon successful login.
549549

550+
```js
551+
import Vuex from 'vuex'
552+
import feathersClient from './feathers-client'
553+
import feathersVuex from 'feathers-vuex'
554+
555+
const { auth } = feathersVuex(feathersClient, { idField: '_id' })
556+
557+
const store = new Vuex.Store({
558+
plugins: [
559+
auth({ userService: 'users' }) // if your user service endpoint is named 'users'
560+
]
561+
})
562+
```
563+
550564
## License
551565

552566
Copyright (c) Forever and Ever, or at least the current year.

0 commit comments

Comments
 (0)