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

Login reg #7

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Login reg #7

wants to merge 12 commits into from

Conversation

BigUncleYemi
Copy link
Collaborator

this commit is to review the login and register page for the app

thing to note :

  1. api endpoint are to be added at User/index.js, Helper/auth.js, Config/constants.js
  2. to demand for auth at any component import withAuth class from Config/constants.js and wrapper the Component with that class .e.g. export default withAuth(nameofcomponent).

<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<button type="button" className="form-submit" onClick={this.handleLogout}>Logout</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this onClick event triggers the handleLogout method? you need to bind it .

@@ -0,0 +1,99 @@
import decode from 'jwt-decode';

export default class AuthService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have your AuthService class setup to handle authentication then you should use it for your App component (handleLogout)

@BigUncleYemi
Copy link
Collaborator Author

add the auth and binded the handleLogout

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.

3 participants