Skip to content

Commit

Permalink
Merge pull request #39 from NicolasMarqui/FixNotistack
Browse files Browse the repository at this point in the history
DA-44, DA-52 and DA-53: Notistack fixes
  • Loading branch information
saul-data authored Dec 24, 2021
2 parents 1a9259e + fe4ff93 commit 8187a7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function App() {
</Button>
)}
autoHideDuration={60000}
style={{ marginTop: 80 }}
>
<Box className="app" backgroundColor="background.main">
<UserAuth
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/components/LoginForm/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const LoginForm = ({ handleNext }) => {
const {
register,
handleSubmit,
watch,
formState: { errors },
} = useForm();

Expand All @@ -26,12 +25,16 @@ const LoginForm = ({ handleNext }) => {

let response = await loginUser(allData);

if(!response){
return enqueueSnackbar("An error has occured", { variant: "error" });
}

if(response && response?.access_token){
localStorage.setItem("refresh_token", response.refresh_token);
history.push(`loginCallback?accesstoken=${response.access_token}&refreshtoken=${response.refresh_token}`)
}else{
response.errors.map(err => {
enqueueSnackbar(err.message, { variant: "error" });
return enqueueSnackbar(err.message, { variant: "error" });
})
}
}
Expand Down

0 comments on commit 8187a7d

Please sign in to comment.