broke af
This commit is contained in:
@@ -20,7 +20,7 @@ export const AppContextProvider = ({ children, baseURL }: Props) => {
|
||||
const api = axios.create({ baseURL })
|
||||
|
||||
api.interceptors.request.use((config) => {
|
||||
config.url += '?format=json'
|
||||
// config.url += '?format=json'
|
||||
return config
|
||||
})
|
||||
|
||||
|
@@ -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">
|
||||
|
Reference in New Issue
Block a user