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

Feature: Set LocalStorage and Context When a Customer Logs In #55

Open
7 tasks
larkinds opened this issue Sep 11, 2023 · 0 comments
Open
7 tasks

Feature: Set LocalStorage and Context When a Customer Logs In #55

larkinds opened this issue Sep 11, 2023 · 0 comments

Comments

@larkinds
Copy link
Owner

larkinds commented Sep 11, 2023

Overview
When a customer logs in, we want to persist their login across all pages of the application - even if they navigate away from the website briefly. To do so, provide a context for all pages of the webpage and set localStorage.

This issue depends on #43 being complete.

Actions

  • Set up context for the application, at the top level (main.tsx)
  • Update useContext to reflect the currently signed in user’s username
  • Set localStorage with logged in user’s username
  • Set expiration datetime for localStorage
    - [ ] For products
    - [ ] For customer login status
  • If there is already state persisted within the application when a user logs in (in either reducer) make sure that state does not change
  • You’ve checked that you’ve followed the [Rules of Hook](https://legacy.reactjs.org/docs/hooks-rules.html
  • Handoff to the team implementing the header

Resources
React's Guide to Context
useContext API

@larkinds larkinds changed the title Set LocalStorage and Context When a Customer Logs In Feature: Set LocalStorage and Context When a Customer Logs In Sep 11, 2023
@jgesel jgesel removed their assignment Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants