Initial commit: restructure to flat layout with ui/ and web/ at root
This commit is contained in:
10
web/server/lib/github/octokit.js
Normal file
10
web/server/lib/github/octokit.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Octokit } from '@octokit/rest';
|
||||
import { getGitHubAuth } from './auth.js';
|
||||
|
||||
export function getOctokitOrNull() {
|
||||
const auth = getGitHubAuth();
|
||||
if (!auth?.accessToken) {
|
||||
return null;
|
||||
}
|
||||
return new Octokit({ auth: auth.accessToken });
|
||||
}
|
||||
Reference in New Issue
Block a user