From the course: Angular: Creating and Hosting a Full-Stack Site
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create listings with Auth
From the course: Angular: Creating and Hosting a Full-Stack Site
Create listings with Auth
- [Instructor] So let's take a look at how to incorporate authentication into our new listings page and the corresponding server end point. Now, just like with getting a user's listings, we're going to start off by modifying the create listing method in the listing service. This will probably look very familiar. We're going to say something like this. We're going to say return new observable listing, and then we're going to say observer, and we're going to say this dot auth dot user dot subscribe, and get the currently authenticated user. And then we're going to get the user's auth token, so we're going to say user and user dot get ID token, and then we're going to say dot then, since this is a promise, and we're going to say token, and once we have the token we're going to copy and paste the original request like this without the return statement. So we're going to say this dot http dot post listing. We're going to send it…
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)
-
-