Skip to content

feature(logout): logout clears token and email #5

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mcspach
Copy link
Owner

@mcspach mcspach commented Jun 25, 2021

Changes

  1. change path to main page '/' in Nav Link
  2. add function as prop - logs out the user by clearing auth values

Purpose

The "Log out" section of the nav should navigate the user to the main page and clear the login status in redux.

Approach

-Never used REDUX before. Got pretty confused with connect API and how dispatch works.
-Used loginForm as base for writing function and getting correct import/export
-added onClick and function to dispatch back to authActions.js
-Used console.log(state, action.type) inside of each action to check if state was being set properly

##Resources
https://react-redux.js.org/api/connect
https://read.reduxbook.com/markdown/part1/04-action-creators.html

Closes Shift3#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Log Out
1 participant