Open anshdube10801 opened 2 years ago
Signup Code is ok But i also faced problem with signup when register new user cant go to home with page and was getting error.that was because of token .cuz we got auth token only when we use login .signup only gives us first token which get not approved by our app.so i simply navigate to login after signup.then login and no error occurred. if (json.success) { //save token of user localStorage.setItem('auth-token', json.authtoken) navigate('/login'); props.showAlert("SuccessFully Created Account", "success") } else { props.showAlert("Invalid Creadentails", "danger") }
this in SignUp.js
Here's the code. Warning:- React Router Dom version is 6 https://github.com/codewithlaksh/ReactJS-iNotebook