From the course: Building Your First CLI App in Node
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Register a new token
From the course: Building Your First CLI App in Node
Register a new token
- [Instructor] The next thing we're going to do is build our registerNewToken function. Let's use a try statement to check whether authentication and registering a new oauth token works or not. First, we will try to get the token, as defined here, and we're going to store this inside of response const, and what we're doing is waiting for our our octokit to return something to us. Inside of this createAuthorization, we also need to set some scopes, and a note for whoever receives the token about what app we have. We're setting these for user, public_repo, repo, as well as the repo:status. The last thing we're going to set in here is a note. This note is going to be registered on all of the tokens that you place on other users' profiles, so this is just to let them know what app has been there with a token. So I'm going to say "musette: a cool tool for dev workflow automation." These scopes are keys which specify the permissions the application requires. If you don't specify a scopes…
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
-
-
-
-