aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/CallbackPage.tsx17
-rw-r--r--src/pages/LandingPage.tsx5
2 files changed, 21 insertions, 1 deletions
diff --git a/src/pages/CallbackPage.tsx b/src/pages/CallbackPage.tsx
new file mode 100644
index 0000000..caa384f
--- /dev/null
+++ b/src/pages/CallbackPage.tsx
@@ -0,0 +1,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>;
+}
diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx
index 60deb30..2e2bfd6 100644
--- a/src/pages/LandingPage.tsx
+++ b/src/pages/LandingPage.tsx
@@ -5,6 +5,7 @@ import HeaderBar from "../components/HeaderBar";
import FormListing from "../components/FormListing";
import { getForms } from "../api/forms";
+import OAuth2Button from "../components/OAuth2Button";
function LandingPage() {
return <div>
@@ -17,7 +18,9 @@ function LandingPage() {
flex-direction: column;
`}>
<h1>Available Forms</h1>
-
+
+ <OAuth2Button/>
+
{getForms().map(form => (
<FormListing key={form.id} form={form}/>