blob: 1abad1be16e00a044752096f035445d0405c5762 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
"use client";
import { useEffect } from "react";
function MessagePoster({ jwt }: { jwt: string }) {
useEffect(() => {
if (typeof window === "undefined") return;
window.postMessage({ jwt }, "*");
}, [jwt]);
return (
<button
className="p-2"
onClick={() => {
if (typeof window === "undefined") return;
window.postMessage({ jwt }, "*");
}}
>
Extension Auth
</button>
);
}
export default MessagePoster;
|