sign up to login
This commit is contained in:
@@ -3,7 +3,6 @@ import { IconMail, IconLock } from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import { toast } from "react-toastify";
|
||||
import http from "../http";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
export default function SignupView({
|
||||
onLogin,
|
||||
@@ -21,8 +20,6 @@ export default function SignupView({
|
||||
const [password, setPassword] = useState("");
|
||||
const [confirmPassword, setConfirmPassword] = useState("");
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const validatePassword = (password: string): boolean => {
|
||||
const passwordComplexityRegex =
|
||||
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{12,}$/;
|
||||
@@ -78,8 +75,9 @@ export default function SignupView({
|
||||
throw new Error("Failed to sign up");
|
||||
}
|
||||
|
||||
toast.success("User signed up successfully");
|
||||
navigate("/");
|
||||
toast.success("Welcome to Ace Job, " + firstName + "!", {
|
||||
onClose: onLogin,
|
||||
});
|
||||
} catch (error) {
|
||||
toast.error((error as any).response?.data || "Error during signup");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user