Skip to content

Commit

Permalink
hotfix(register): navigate on success
Browse files Browse the repository at this point in the history
Signed-off-by: Mael-RABOT <[email protected]>
  • Loading branch information
Mael-RABOT committed Dec 10, 2024
1 parent 19c26d8 commit 1e8344f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client_web/src/Pages/Auth/Forms/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ const Register = () => {
console.error('JWT not found in response');
return;
}
toast.success('Successfully registered!');
setJsonWebToken(response?.data?.jwt);
setIsAuthenticated(true);
if(isAuthenticated) {
navigate('/dashboard');
}
navigate('/dashboard');
})
.catch((error) => {
console.error('Failed:', error);
Expand Down

0 comments on commit 1e8344f

Please sign in to comment.