icns-frontend/pages/index.tsx
2022-12-05 17:57:06 +09:00

20 lines
400 B
TypeScript

interface AuthResponse {
authUrl: string;
}
export default function Home() {
const handleSignInWithTwitter = async () => {
const response: AuthResponse = await (await fetch("/api/auth")).json();
window.location.href = response.authUrl;
};
return (
<div>
<div>
<button onClick={handleSignInWithTwitter}>Sign in with Twitter</button>
</div>
</div>
);
}