Skip to content

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.

4 participants