From the course: React: Cloud-Powered Apps with Firebase

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Redirect user upon signup

Redirect user upon signup

From the course: React: Cloud-Powered Apps with Firebase

Start my 1-month free trial

Redirect user upon signup

- [Narrator] As of know, once a user signs up, and we have a session, we have to manually type in /profile in order to go to that route. Once a user successfully signs up, we actually want to take them to the new profile page. Heading first over to the sign-up function, let's grab a hold of the newly created user. We can grab the user from the response, then we can update this line to simply user.updateProfile, and finally we can return the user here. Let's head over to the sign-up component now, because we are supplying this component in the route component as a prop, we get props passed into the sign-up component, and in particular, we get access to the history prop, which will be useful in order to route the user to a different page. We can first grab the newly created user, just create a variable, and then we can set the user here. If we having a user, we can use props. Let me rename that to props.…

Contents