- User Registers & then redirected to Login page.
- Enters email & clicks login.
2.1. We create a token/OTP, hash it and send email with the hash embeded into the URL
2.2. When user clicks the link, we get the hash & verify the token.
2.3. Decode the hash, find the token in DB with id & email.
2.4. If the token is found we sign it with JWT and set cookie with user information. - We then read the set cookie and dispatch user info to Redux store.
- Each minute a function checks if the cookie is still present in application memory, if its not we will dispach a logout.