-
Notifications
You must be signed in to change notification settings - Fork 3
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
#164046210: users can log in #13
Conversation
d4e9816
to
925ea31
Compare
@MandelaK, kindly rebase so as to add coveralls to your PR. |
8936f1d
to
881938e
Compare
21513f9
to
ade0b36
Compare
ade0b36
to
519e3e9
Compare
519e3e9
to
bffa2d6
Compare
bffa2d6
to
2580f7d
Compare
2580f7d
to
e27770d
Compare
0bf8e35
to
8261bc0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK
8261bc0
to
a548d3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Please fix the hound format @MandelaK |
a548d3d
to
1704693
Compare
4bbe1b0
to
86d68e0
Compare
c0958ae
to
f16e68e
Compare
1be081e
to
1c1ff78
Compare
@MandelaK], kindly fix the merge conflicts. |
1c1ff78
to
29347d9
Compare
- create login form - users can log in - errors are displayed above the specific input fields and input fields have a red border if they are not validated - set up validation of input fields - configure axios - test loginReducer - test login validator function - tokens are stored in localStorage on successful login - add function for validating authentication tokens - add function for checking whether a user is logged in with valid jwt token - users are redirected on successful login to the homepage - logged in users cannot see the login form - test login form - add a spinner when a user is logging in - store profile image, username and token when a user logs in [starts #164046210] [finishes #164046210]
29347d9
to
a3c9b00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
Add login functionality to the application. When a user fills in the login form, they should get an appropriate response. Error messages are displayed in red and form validation is done when the form is submitted.
Description of task
Users should be able to log in so they can be identified and have a custom experience. When a user logs in, we store the token and dispatch an action to the redux store. A helper function is implemented to ensure that only valid tokens can be decoded.
The following are saved to localStorage when a user logs in:
-
profileImage
- Link to the user's profile image-
token
- The user's token-
email
- The user's email-
username
- The username of the userHow has this been tested?
How can this be manually tested?
ft-users-login-#164046210
REACT_APP_BASE_URL
to the env file and have it's value point tohttps://ah-legion-staging.herokuapp.com/api/
or your custom backend. Also add aREACT_APP_SECRET_KEY
which should be the same as that on heroku.Other information
utils
that checks whether a user is logged in by attempting to authenticate the token stored in thelocalStorage
npm install
and properly configure environment variables. Also restart your server and runsource .env
.axiosConfig
to make API callsPT
164046210