import { signIn } from 'next-auth/client' import Button from 'react-bootstrap/Button' import styles from './login.module.css' import GithubIcon from '../svgs/github-fill.svg' import TwitterIcon from '../svgs/twitter-fill.svg' import LightningIcon from '../svgs/bolt.svg' import { Form, Input, SubmitButton } from '../components/form' import * as Yup from 'yup' import { useState } from 'react' import Alert from 'react-bootstrap/Alert' import LayoutCenter from '../components/layout-center' import { useRouter } from 'next/router' import { LightningAuth } from './lightning-auth' export const EmailSchema = Yup.object({ email: Yup.string().email('email is no good').required('required') }) 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: 'Lightning auth failed.', default: 'Unable to sign in.' } const [errorMessage, setErrorMessage] = useState(error && (errors[error] ?? errors.default)) const router = useRouter() return (