From the course: Building Your First CLI App in Node
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Authenticate with GitHub
From the course: Building Your First CLI App in Node
Authenticate with GitHub
- [Instructor] For the purposes of this project, it's probably the most simple to deactivate two-factor authentication on your GitHub account if you have two-factor authentication currently enabled. Now that we're connected to the GitHub API, and have some core functions skeleton-outlined, let's build out the rest of the functionality to authenticate our users using the GitHub API Octokit. Some of our GitHub methods are already set up in our inquirer file. So let's be sure to require inquirer at the top of our GitHub credentials file. Then, we're going to work inside of our setGitHubCredentials function near the bottom here. Inside of our setGitHubCredentials, we're going to create a const called credentials. This is going to store the information retrieved from the askGitHubCredentials prompts we set up in our inquirer file. So here, we're going to await inquirer and it's askGitHubCredentials. When we're using the command await here, this is an operator used to wait for a promise and…
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
-
-
-
-
-
Understand user prompts1m 46s
-
(Locked)
Create a prompt for user input2m 24s
-
(Locked)
Validate user input1m 53s
-
(Locked)
Store GitHub credentials for reuse3m 2s
-
(Locked)
Receive the GitHub token3m 39s
-
(Locked)
Authenticate with GitHub2m 29s
-
(Locked)
Register a new token3m 23s
-
(Locked)
Implement the GitHub token3m 31s
-
-
-
-