This project is created for test and run best practices hello world.
- JWT authentication with refresh tokens: Store JWT access token in memory and refresh token in cookie.
- Use JWT to generate access and refresh token and send to client after login request.
- Client store JWT access token in memory and refresh token stored in cookie from backend response.
- After any page refresh, if user is logined, client call refresh request and update tokens.
- User can aceess to required_auth APIs with in memory access token.
- Use refresh token, AuthProvider context and AuthManager component.
- Definition: It's update in next sequence after login (Profile.js) X No!
Problem is render Profile page twice (one after login, one after refresh). Both of them fetch request to server. - Resolve this issue with remove wrong useffect dependencies.
- Use csurf (CSRF token middleware) package and CsrfManager component.
5. Check and Verify Authentication Mechanism Functionality after the Access Token Expires. [:heavy_check_mark:]
- Now: If access token expires, land on login page. Problem: refresh token is ok and must use it rather re-login.
- Use refresh api call after request is failed.
- Use from custom axios and clear console is catch blocks.
React from Scratch\ React Global State with Context