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
From the course: React: Cloud-Powered Apps with Firebase
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.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Firebase Authentication setup3m 20s
-
Creating users6m 57s
-
(Locked)
Displaying current user7m 17s
-
(Locked)
Redirect user upon signup2m 30s
-
(Locked)
User logout3m 55s
-
(Locked)
User login4m 56s
-
(Locked)
Authenticated user redirect4m 38s
-
(Locked)
Challenge: Authentication redirect2m 30s
-
(Locked)
Solution: Authentication redirect2m 2s
-
-
-
-
-
-
-