From the course: Firebase Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create other auth wrapper functions - Google Cloud Tutorial
From the course: Firebase Essential Training
Create other auth wrapper functions
- [Instructor] The next thing we're going to do is create wrappers for the rest of our Firebase auth functions that we'll be using in our front end. So let's start off by creating all the files we'll need for our wrapper functions. Inside our auth folder here, let's create a file called signOut.js. We'll create another file called addAuthListener.js. And we'll add another one called getCurrentUser.js. And you'll see what these are all going to do in just a minute. So we're going to start off by wrapping Firebase's signOut function. And this one is actually going to be super simple. We're just going to import Firebase up at the top, import firebase from firebase/app. And then we're going to define the function which will be async and won't take any arguments. So we'll say export const signOut equals async. And then for the body of the function, we're just going to have a try block with a catch block that catches the default…
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
-
-
-
-
What is Firebase Auth?2m 41s
-
(Locked)
Set up the sign-in methods2m 58s
-
(Locked)
Important Firebase Auth functions4m 32s
-
(Locked)
Avoid vendor lock-in3m 24s
-
(Locked)
Create a sign-in wrapper function4m 57s
-
(Locked)
Create other auth wrapper functions4m 40s
-
(Locked)
Add private routes8m 49s
-
(Locked)
Sign in and sign out4m 48s
-
(Locked)
Authentication pricing1m 9s
-
-
-
-
-
-
-
-