Skip to content

Commit 9a3305d

Browse files
authored
Fixes default storageKey value. It should be 'feathers-jwt' because this value is default in @feathersjs/authentication-client (#165)
1 parent 4063e74 commit 9a3305d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const options = {
7979

8080
```js
8181
const options = {
82-
storageKey: 'token', // The key in localStorage used to store the authentication token
82+
storageKey: 'feathers-jwt', // The key in localStorage used to store the authentication token
8383
authenticate: { // Options included in calls to Feathers client.authenticate
8484
strategy: 'local', // The authentication strategy Feathers should use
8585
},
@@ -210,4 +210,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
210210
<!-- prettier-ignore-end -->
211211
<!-- ALL-CONTRIBUTORS-LIST:END -->
212212

213-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
213+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

src/authClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default (client, options = {}) => (type, params) => {
2121
redirectTo,
2222
logoutOnForbidden,
2323
} = Object.assign({}, {
24-
storageKey: 'token',
24+
storageKey: 'feathers-jwt',
2525
authenticate: { strategy: 'local' },
2626
permissionsKey: 'permissions',
2727
permissionsField: 'roles',

test/types/index.test-d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const configInvalid = {
4545
expectError(restClient(null, configInvalid));
4646

4747
const allAuthOptions = {
48-
storageKey: 'token', // The key in localStorage used to store the authentication token
48+
storageKey: 'feathers-jwt', // The key in localStorage used to store the authentication token
4949
authenticate: { // Options included in calls to Feathers client.authenticate
5050
strategy: 'local', // The authentication strategy Feathers should use
5151
},
@@ -60,10 +60,10 @@ const allAuthOptions = {
6060
expectType<IAuthClientResult>(authClient(null, allAuthOptions));
6161

6262
const someOptions = {
63-
storageKey: 'token', // The key in localStorage used to store the authentication token
63+
storageKey: 'feathers-jwt', // The key in localStorage used to store the authentication token
6464
authenticate: { // Options included in calls to Feathers client.authenticate
6565
strategy: 'local', // The authentication strategy Feathers should use
6666
},
6767
}
6868

69-
expectType<IAuthClientResult>(authClient(null, someOptions));
69+
expectType<IAuthClientResult>(authClient(null, someOptions));

0 commit comments

Comments
 (0)