fix: error when login

This commit is contained in:
Renge 2022-09-21 16:21:27 -04:00
parent 6ee80f6baa
commit 8594f87988
3 changed files with 735 additions and 322 deletions

File diff suppressed because it is too large Load Diff

View File

@ -82,8 +82,10 @@ function AuthContextProvider(props) {
const response = await api.registerUser(userData); const response = await api.registerUser(userData);
if (response.status === 200) { if (response.status === 200) {
authReducer({ authReducer({
type: AuthActionType.LOGOUT_USER, type: AuthActionType.LOGIN_USER,
payload: null, payload: {
user: response.data.user
}
}) })
history.push("/"); history.push("/");
store.loadIdNamePairs(); store.loadIdNamePairs();

View File

@ -3,6 +3,9 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "MIT",
"scripts": {
"start": "nodemon index.js"
},
"dependencies": { "dependencies": {
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",