Skip to content

Commit

Permalink
sign up logic, sorry zac, i didnt push it
Browse files Browse the repository at this point in the history
  • Loading branch information
SilveerDusk committed May 22, 2024
1 parent 69e713c commit df436d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/pages/SignupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const SignupPage = ({
}) => {
const [firstName, setFirstName] = useState("");
const [lastName, setLastName] = useState("");
const [username, setUsername] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
Expand All @@ -33,6 +34,7 @@ const SignupPage = ({
if (
firstName === "" ||
lastName === "" ||
username === "" ||
email === "" ||
password === "" ||
confirmPassword === ""
Expand All @@ -49,7 +51,7 @@ const SignupPage = ({
"Content-Type": "application/json",
},
body: JSON.stringify({
username: firstName + lastName,
username: username,
email: email,
password: password,
firstName: firstName,
Expand All @@ -67,7 +69,7 @@ const SignupPage = ({
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ username: firstName + lastName, password }),
body: JSON.stringify({ username, password }),
});
if (login.status === 200) {
const data = await login.json();
Expand Down Expand Up @@ -148,6 +150,7 @@ const SignupPage = ({
type="text"
borderColor="#216869"
_hover={{ borderColor: "#49A078" }}
onChange={(e) => setUsername(e.target.value)}
/>
</FormControl>
<FormControl id="password" isRequired>
Expand Down

0 comments on commit df436d6

Please sign in to comment.