mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-31 23:02:29 +00:00
* Rev up prettier * Reformat * Remove deprecated tslint * Remove call to tslint and update package-lock.json
28 lines
633 B
TypeScript
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();
|
|
}
|
|
});
|