Files
cosmos-explorer/src/GitHub/GitHubConnector.ts
Laurent Nguyen 90c1439d34 Update prettier to latest. Remove tslint (#1641)
* Rev up prettier

* Reformat

* Remove deprecated tslint

* Remove call to tslint and update package-lock.json
2023-10-03 17:13:24 +02:00

28 lines
633 B
TypeScript

import postRobot from "post-robot";
export interface IGitHubConnectorParams {
state: string;
code: string;
}
export const GitHubConnectorMsgType = "GitHubConnectorMsgType";
window.addEventListener("load", async () => {
const openerWindow = window.opener;
if (openerWindow) {
const params = new URLSearchParams(document.location.search);
await postRobot.send(
openerWindow,
GitHubConnectorMsgType,
{
state: params.get("state"),
code: params.get("code"),
} as IGitHubConnectorParams,
{
domain: window.location.origin,
},
);
window.close();
}
});