You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62Lines changed: 62 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,12 @@ Keep your session sync with localStorage and Redux :key:
10
10
Redux React Session provides an API that allows to manage sessions through the app, with authorization function for [react-router](https://github.com/ReactTraining/react-router) and a persisted session.
11
11
12
12
## Installation
13
+
yarn:
14
+
15
+
`yarn add redux-react-session`
16
+
17
+
npm:
18
+
13
19
`npm install redux-react-session --save`
14
20
15
21
## Usage
@@ -109,3 +115,59 @@ Returns the current user if exists
109
115
110
116
### deleteUser : Promise
111
117
Deletes the current user
118
+
119
+
## Server Rendering
120
+
`redux-react-session` also provides methods to keep the session with server rendering using cookies. So the session will work on the server side as well as the client side.
Authorization function for [react-router](https://github.com/ReactTraining/react-router) to restrict routes, it checks if exist a session and redirects to the `redirectPath`.
155
+
156
+
The difference between `checkAuthServer` and `checkAuth` is that the first one is used in the server side and check the authorization with the cookies in the request.
0 commit comments