From the course: Angular: Creating and Hosting a Full-Stack Site
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Edit listings with Auth
From the course: Angular: Creating and Hosting a Full-Stack Site
Edit listings with Auth
- [Instructor] Now that we've done the create listing flow, our next step is to incorporate user authentication into the edit listing flow. This will actually be incredibly similar to what we just saw. What we're going to do is head over to our front end. And scroll down to the editListing method. And inside there, we're going to say return new Observable Listing. And then we're going to say observer. And this is going to be a callback. And inside there, we're going to say this.auth.user.subscribe. And we're going to use that user object to get the user's ID token. So we're going to say user && user.getIdToken.then. And once we have the token, we're going to copy and paste the original request here into this callback. And we're going to change this to httpOptionsWithAuthToken. Token. And then we're going to say .subscribe and just call observer. Oops, and actually this should be observer up here. So we're going to say…
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
-
-
-
-
-
-
-
(Locked)
What is Firebase Auth?2m 18s
-
(Locked)
Set up a Firebase account3m 8s
-
(Locked)
Add Firebase to Angular3m 48s
-
(Locked)
Add Firebase to hapi3m 58s
-
(Locked)
Sign in and out5m 27s
-
(Locked)
Load user listings with Auth7m 10s
-
(Locked)
Create listings with Auth3m 30s
-
(Locked)
Edit listings with Auth2m 42s
-
(Locked)
Delete listings with Auth3m 13s
-
(Locked)
-
-