Skip to content

Commit 5885ed0

Browse files
committed
Document the new auth getters
1 parent e80998c commit 5885ed0

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

docs/3.0-major-release.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,19 @@ And now it has become the best way to perform queries with Feathers-Vuex. To fi
2020

2121
Version 3.1 of Feathers-Vuex enables ability to add custom handling for each of the FeathersJS realtime events. You can read more about it in the [Service Plugin: Events](./service-plugin.md#service-events) docs.
2222

23-
## A Single Breaking Change
23+
## Breaking Changes
2424

25-
Since Feathers-Vuex follows semantic versioning, a single, small breaking change is the reason for the major version bump. Feathers-Vuex 3.0 has only one breaking change:
25+
Feathers-Vuex follows semantic versioning. There are two breaking changes in this release:
26+
27+
### Auth Plugin `user` Not Reactive <Badge text="3.2.0+" />
28+
29+
Due to changes in how reactivity is applied to service state (it's now using Vue.set under the hood), the `user` state of the `auth` module is no longer reactive. To fix this issue, two getters have been added to the `auth` state. They are available when a `userService` is provided to the `makeAuthPlugin` options.
30+
31+
- `user`: returns the reactive, logged-in user from the `userService` specified in the options.
32+
- `isAuthenticated`: a easy to remember boolean attribute for if the user is logged in.
33+
34+
35+
### Server-Side Pagination Support is Off by Default
2636

2737
The `makeFindMixin` (and the new `useFind` utility) now have server-side pagination support turned off, by default. Real-time arrays of results are now the default setting. This really improves the development experience, especially for new users.
2838

docs/auth-plugin.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ It includes the following state by default:
4040
}
4141
```
4242

43+
## Getters
44+
45+
Two getters are available when a `userService` is provided to the `makeAuthPlugin` options.
46+
47+
- `user`: returns the reactive, logged-in user from the `userService` specified in the options.
48+
- `isAuthenticated`: a easy to remember boolean attribute for if the user is logged in.
49+
4350
## Actions
4451

4552
The following actions are included in the `auth` module. Login is accomplished through the `authenticate` action. For logout, use the `logout` action. It's important to note that the records that were loaded for a user are NOT automatically cleared upon logout. Because the business logic requirements for that feature would vary from app to app, it can't be baked into Feathers-Vuex. It must be manually implemented. The recommended solution is to simply refresh the browser, which clears the data from memory.

0 commit comments

Comments
 (0)