icns-frontend/pages/index.tsx
2022-12-05 19:50:13 +09:00

22 lines
472 B
TypeScript

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