mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Fix auth
This commit is contained in:
parent
517c618537
commit
8de70a0035
@ -1,5 +1,6 @@
|
||||
import { Intent } from "matrix-bot-sdk";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { createTokenAuth } from "@octokit/auth-token";
|
||||
import { UserTokenStore } from "./UserTokenStore";
|
||||
import { BridgeConfig } from "./Config";
|
||||
import uuid from "uuid/v4";
|
||||
@ -47,6 +48,7 @@ export class AdminRoom {
|
||||
let me;
|
||||
try {
|
||||
const octokit = new Octokit({
|
||||
authStrategy: createTokenAuth,
|
||||
auth: accessToken,
|
||||
userAgent: "matrix-github v0.0.1",
|
||||
});
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { Appservice, IAppserviceRegistration, SimpleFsStorageProvider } from "matrix-bot-sdk";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { createTokenAuth } from "@octokit/auth-token";
|
||||
import { createAppAuth } from "@octokit/auth-app";
|
||||
import markdown from "markdown-it";
|
||||
import { IBridgeRoomState, BRIDGE_STATE_TYPE } from "./BridgeState";
|
||||
import { BridgeConfig } from "./Config";
|
||||
@ -43,6 +45,7 @@ export class GithubBridge {
|
||||
log.debug(this.queue);
|
||||
|
||||
this.octokit = new Octokit({
|
||||
authStrategy: createAppAuth,
|
||||
auth: {
|
||||
id: parseInt(this.config.github.auth.id as string),
|
||||
privateKey: await fs.readFile(this.config.github.auth.privateKeyFile, "utf-8"),
|
||||
@ -468,6 +471,7 @@ export class GithubBridge {
|
||||
return;
|
||||
}
|
||||
const clientKit = new Octokit({
|
||||
authStrategy: createTokenAuth,
|
||||
auth: senderToken,
|
||||
userAgent: "matrix-github v0.0.1",
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user