I just started attempting to signup with Moralis and it actually worked a couple hours ago, the thing is adding a new user actually worked but I wanted to add the ‘name’ to the server too… Now I keep trying to add another user but every time its a Bad Request…
import React, {useState} from 'react'
import './Register.css'
import { Form, Button, Modal, InputGroup } from 'react-bootstrap'
import Navy from './Navbar'
import {useMoralis} from 'react-moralis'
const RegisterAdd = () => {
const { signup } = useMoralis();
const [name, setName] = useState("");
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [email, setEmail] = useState("");
return(
<div>
<Form>
<Modal.Body>
<Form.Group className="mb-3" controlId='name'>
<Form.Label>Name</Form.Label>
<Form.Control type="text" value={name} placeholder="Name" onChange={ (event) => setName(event.target.value) } />
</Form.Group>
<Form.Group className="mb-3" controlId='username'>
<Form.Label>Username</Form.Label>
<InputGroup hasValidation>
<InputGroup.Text id="inputGroupPrepend">@</InputGroup.Text>
<Form.Control type="username" placeholder="Username" value={username} onChange={ (event) => setUsername(event.target.value) } />
</InputGroup>
</Form.Group>
<Form.Group className="mb-3" controlId='password'>
<Form.Label>Password</Form.Label>
<Form.Control type="password" placeholder="Password" value={password} onChange={ (event) => setPassword(event.target.value) }/>
</Form.Group>
<Form.Group className="mb-3" controlId='passwordConfirm'>
<Form.Label>Confirm Password</Form.Label>
<Form.Control type="password" placeholder="Password" />
</Form.Group>
<Form.Group className="mb-3" controlId='email'>
<Form.Label>Email</Form.Label>
<Form.Control type="email" placeholder="Email" value={email} onChange={ (event) => setEmail(event.target.value) } />
<Form.Text className="text-muted">
We'll never share your email with anyone else.
</Form.Text>
</Form.Group>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={Navy.closeModal}>
Close
</Button>
<Button variant="info" onClick={() => signup(username, password, email, {text: name})}>
Register
</Button>
</Modal.Footer>
</Form>
</div>
)
}
export default RegisterAdd