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

Create other auth wrapper functions - Google Cloud Tutorial

From the course: Firebase Essential Training

Start my 1-month free trial

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…

Contents