add epic games connection
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import {
|
||||
Config,
|
||||
ConnectedAccount,
|
||||
ConnectionCallbackSchema,
|
||||
ConnectionLoader,
|
||||
DiscordApiErrors,
|
||||
} from "@fosscord/util";
|
||||
import fetch from "node-fetch";
|
||||
import { Config, ConnectedAccount, ConnectionCallbackSchema, DiscordApiErrors } from "../../util";
|
||||
import Connection from "../../util/connections/Connection";
|
||||
import { ConnectionLoader } from "../../util/connections/ConnectionLoader";
|
||||
import { GitHubSettings } from "./GitHubSettings";
|
||||
|
||||
interface OAuthTokenResponse {
|
||||
@@ -89,7 +94,9 @@ export default class GitHubConnection extends Connection {
|
||||
}).then((res) => res.json());
|
||||
}
|
||||
|
||||
async handleCallback(params: ConnectionCallbackSchema): Promise<ConnectedAccount | null> {
|
||||
async handleCallback(
|
||||
params: ConnectionCallbackSchema,
|
||||
): Promise<ConnectedAccount | null> {
|
||||
const userId = this.getUserId(params.state);
|
||||
const token = await this.exchangeCode(params.state, params.code!);
|
||||
const userInfo = await this.getUser(token);
|
||||
|
||||
Reference in New Issue
Block a user