import React, { Fragment, useState } from 'react'; import { AuthorizerBasicAuthLogin, AuthorizerForgotPassword, AuthorizerMagicLinkLogin, AuthorizerSocialLogin, useAuthorizer, } from '@authorizerdev/authorizer-react'; import styled from 'styled-components'; import { Link } from 'react-router-dom'; const enum VIEW_TYPES { LOGIN = 'login', FORGOT_PASSWORD = 'forgot-password', } const Footer = styled.div` display: flex; flex-direction: column; justify-content: center; align-items: center; margin-top: 15px; `; const FooterContent = styled.div` display: flex; justify-content: center; align-items: center; margin-top: 10px; `; export default function Login({ urlProps }: { urlProps: Record }) { const { config } = useAuthorizer(); const [view, setView] = useState(VIEW_TYPES.LOGIN); const isBasicAuth = config.is_basic_authentication_enabled; return ( {view === VIEW_TYPES.LOGIN && (

Login


{(config.is_basic_authentication_enabled || config.is_mobile_basic_authentication_enabled) && !config.is_magic_link_login_enabled && ( )} {config.is_magic_link_login_enabled && ( )} {(config.is_basic_authentication_enabled || config.is_mobile_basic_authentication_enabled) && (
setView(VIEW_TYPES.FORGOT_PASSWORD)} style={{ marginBottom: 10 }} > Forgot Password?
)}
)} {view === VIEW_TYPES.FORGOT_PASSWORD && (

Forgot Password

setView(VIEW_TYPES.LOGIN)} style={{ marginBottom: 10 }} > Back
)} {config.is_basic_authentication_enabled && !config.is_magic_link_login_enabled && config.is_sign_up_enabled && ( Don't have an account?   Sign Up )}
); }