2025-03-20 - Frontend Authentication with Redux: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
*use both of javascript funtion and react | *use both of javascript funtion and react | ||
*use redux for trigger longin in user-detail | *use redux for trigger longin in user-detail | ||
*trigger another tab is doesn't work for now because each tab has own store login work when use just one tab now | |||
*if use more than one tab another tab must refresh to update login | |||
=Process= | |||
*fist, Component will call loginStart function then check accessToken and accessToken_expire from local storage before login with AWS cognito | *fist, Component will call loginStart function then check accessToken and accessToken_expire from local storage before login with AWS cognito | ||
*after login with AWS cognito will redirect to login component | *after login with AWS cognito will redirect to login component for get accessToken, accessToken_expire, refresh_token and set them in local_storage | ||
*after everything set before redirect to current page componet will update loginStatus by isLogin property in user_detail reducer for trigger user-detail | |||
*then redirect to current page | |||
== other == | == other == | ||
Revision as of 07:04, 17 April 2025
concept
- use both of javascript funtion and react
- use redux for trigger longin in user-detail
- trigger another tab is doesn't work for now because each tab has own store login work when use just one tab now
- if use more than one tab another tab must refresh to update login
Process
- fist, Component will call loginStart function then check accessToken and accessToken_expire from local storage before login with AWS cognito
- after login with AWS cognito will redirect to login component for get accessToken, accessToken_expire, refresh_token and set them in local_storage
- after everything set before redirect to current page componet will update loginStatus by isLogin property in user_detail reducer for trigger user-detail
- then redirect to current page