blob: caa384f04604691b87c50bf7bc498e27536471d0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/** @jsx jsx */
import { jsx } from "@emotion/core";
import { useState } from "react";
export default function CallbackPage() {
const [hasSent, setHasSent] = useState(false);
const params = new URLSearchParams(document.location.search);
const code = params.get("code");
if (!hasSent) {
setHasSent(true);
window.opener.postMessage(code);
}
return <p>Code is {code}</p>;
}
|