Learn about building the bulk of an Auth class.
- [Instructor] Now that we have a decent understanding…of the way authentication is going…to get carried out on our site…we're going to create an auth class…that will help us configure and use the tools…made available to use by the Auth0Lock library.…Here at the top of this auth.js file…let's import Auth0Lock…from the dependency we just added, auth0-lock.…Next, on line 5 let's create a class.…We'll call this AuthService,…we'll make a code block, and then at the beginning…of our class we'll create a constructor.…
This constructor function will be called…when we initially create AuthService.…Next, inside our constructor…I'm going to create a variable called this.lock.…This will be available inside of my class.…Now I'm going to use the Auth0Lock object…that I imported from auth0-lock.…Auth0Lock expects three arguments,…the clientId, the domain, and then a configuration object.…We already have access to the authDomain and the clientId,…because we added them here at the top of our file.…
Let's put those in now.…We'll say clientId and authDomain,…
- Installing local dependencies
- Generating a starter project
- Deploying to Heroku
- Planning your development process
- Using styled-components
- Styling for mobile
- Setting up models on Graphcool
- Creating Relay mutations
- Adding Relay to your authentication flow
- Protecting routes with authentication
Skill Level Intermediate
2. Deployment Environments
3. App Functionality
4. Implementing Libraries
5. Creating Components
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.