import { LoginForm } from "cotter-react";
import { CotterEnum } from 'cotter';
const onSuccess = (resp) => {
// RUN SUCCESSFUL FORM SUBMISSION
// SETUP THAT YOU HAVE IN THE DASHBOARD
fetch(`${CotterEnum.WorkerURL}/completion/form?form-id=${encodeURIComponent(formID)}`,{
API_KEY_ID: cotterApiKeyID,
"Content-type": "application/json",
body: JSON.stringify(resp),
window.location.href = "/protected";// redirect to the protected page
type="EMAIL" // - EMAIL or PHONE
authMethod="MAGIC_LINK" // - OTP or MAGIC_LINK
onSuccess={onSuccess} // - A function that runs after the login/signup is successful
onError={(err) => console.log(err)} // - A function that runs if the login/signup encountered an error
width={340} // - Width & height of the form
height={300} // Recommended at least 300x300