Answer the question
In order to leave comments, you need to log in
A good example of implementing authorization and storing user data in the Redux store?
On the Express js backend. With the help of expres-sessions, I authorize the user, set the cookie. At the front (react), you need to store information about the user in the editor so that you visit the site for the first time - initializing the user, setting initialState, the only request to the server to get data about the user. This is if there is a cookie, if there are no cookies, we do not store the information, initialState = {}.
Does anyone have a good example of this implementation?
Answer the question
In order to leave comments, you need to log in
There is nothing to implement here:
const store = configureStore();
store.dispatch(init());
const root = (
<Provider store={store}>
<App />
</Provider>
);
isInitializtion: true
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question