mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-02 14:49:33 +02:00
feat: add read-only GitHub App access alongside OAuth
This commit is contained in:
1 parent
e5c44845f0
commit
a60ad6a921
49 files changed
+1754
-139
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { boundAppToken } from "./github-app";
|
||||
import { getCredentialToken } from "./credentials";
|
||||
import { RepositoryStatus } from "./types";
|
||||
import User from "./User";
|
||||
@@ -25,6 +26,7 @@ export default class PullRequest {
|
||||
}
|
||||
|
||||
async getToken() {
|
||||
if (this._model.githubAccess?.kind === "github-app") return boundAppToken(this.owner.id, this._model.githubAccess);
|
||||
return (await getCredentialToken(this.owner.id, "github", { collection: "anonymizedpullrequests", id: this._model._id })) || config.GITHUB_TOKEN;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user