Skip to content

Commit

Permalink
fix: accessToken
Browse files Browse the repository at this point in the history
Signed-off-by: 0x73746F66 <[email protected]>
  • Loading branch information
0x73746F66 committed Jun 12, 2024
1 parent e366043 commit 106ec58
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions functions/github/repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ export async function onRequestGet(context) {
}
try {
const fetcher = new GitHubRepoFetcher(access_token)
console.log('fetcher', fetcher)
console.log('headers', fetcher.headers)
console.log('fetcher', fetcher.repos)
const details = await fetcher.getRepoDetails()
console.log('details', details)
console.log('fetcher', fetcher.repos)
const repos = JSON.stringify(details, null, 2)
console.log('repos', repos)
return Response.json(repos)
Expand All @@ -48,9 +50,8 @@ export async function onRequestGet(context) {
class GitHubRepoFetcher {
constructor(accessKey) {
this.repos = []
this.accessKey = accessKey
this.headers = {
'Authorization': 'Bearer ${this.accessKey}',
'Authorization': `Bearer ${accessKey}`,
'Accept': 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28'
}
Expand Down

0 comments on commit 106ec58

Please sign in to comment.