Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T8: Auto login by token from localStorage #14

Open
8 of 15 tasks
aleyna-yildizli opened this issue Mar 2, 2024 · 0 comments
Open
8 of 15 tasks

T8: Auto login by token from localStorage #14

aleyna-yildizli opened this issue Mar 2, 2024 · 0 comments
Assignees

Comments

@aleyna-yildizli
Copy link
Owner

aleyna-yildizli commented Mar 2, 2024

  • As a client;

    • when I open web page for the first time I need to signup and login
    • after closing, if I open app again there will be token info in localStorage
    • if there is token, app on load first should make a get request to verify
    • if token authorized, backend will response user information and client will be logged in automatically
  • on app start it should check if there is token in localStorage

    • if there is
      • put token to axios authorization header
        { Authorization: token }
        NOT: Do not add “Bearer ” + token
      • make a GET request to “/verify” endpoint
      • if token is authorized, you will get User object
        • put User object to reducer
        • renew token in localStorage & axios header
    • if token is not authorized,
      • delete token from local storage
      • delete token from axios header
@aleyna-yildizli aleyna-yildizli self-assigned this Mar 2, 2024
@aleyna-yildizli aleyna-yildizli converted this from a draft issue Mar 2, 2024
@aleyna-yildizli aleyna-yildizli moved this from In progress to In review in @aleyna-yildizli's e-commerce project Mar 5, 2024
@erhanfirat erhanfirat moved this from In review to Done in @aleyna-yildizli's e-commerce project Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant