This commit is contained in:
Elijah Lucian
2021-07-15 15:13:43 -06:00
parent f0f4494553
commit 83fdd5b79a
5 changed files with 13 additions and 11 deletions
+4 -6
View File
@@ -5,19 +5,17 @@ import { Form } from '../../elements/Form'
import { Button } from '../../elements/Button'
import { useForm } from 'antd/lib/form/Form'
import { useAppContext } from '../../contexts/AppContext'
import { useStacks } from '../../hooks/getMany/useStacks'
type FormValues = { email: string; password: string }
type FormValues = { username: string; password: string }
export const Login = () => {
const appContext = useAppContext()
const stacks = useStacks('')
const [form] = useForm<FormValues>()
const handleFinish = async ({ email, password }: FormValues) => {
const handleFinish = async ({ username, password }: FormValues) => {
const res = await appContext.post('/dj-rest-auth/login', {
email,
username,
password,
})
console.log(res)
@@ -27,7 +25,7 @@ export const Login = () => {
<div className="login">
<Form onFinish={handleFinish} form={form}>
<h1>Log In</h1>
<FormItem label="email" name="email">
<FormItem label="username" name="username">
<Input />
</FormItem>
<FormItem label="Password" name="password">