import { signIn } from 'next-auth/client' import styles from './login.module.css' import { Form, Input, SubmitButton } from '../components/form' import { useState } from 'react' import Alert from 'react-bootstrap/Alert' import { useRouter } from 'next/router' import { LightningAuthWithExplainer, SlashtagsAuth } from './lightning-auth' import LoginButton from './login-button' import { emailSchema } from '../lib/validate' export function EmailLoginForm ({ text, callbackUrl }) { return (
) } export default function Login ({ providers, callbackUrl, error, text, Header, Footer }) { const errors = { Signin: 'Try signing with a different account.', OAuthSignin: 'Try signing with a different account.', OAuthCallback: 'Try signing with a different account.', OAuthCreateAccount: 'Try signing with a different account.', EmailCreateAccount: 'Try signing with a different account.', Callback: 'Try signing with a different account.', OAuthAccountNotLinked: 'To confirm your identity, sign in with the same account you used originally.', EmailSignin: 'Check your email address.', CredentialsSignin: 'Auth failed', default: 'Unable to sign in.' } const [errorMessage, setErrorMessage] = useState(error && (errors[error] ?? errors.default)) const router = useRouter() if (router.query.type === 'lightning') { return