Comments, appointments adjustments, fixed some issues
This commit is contained in:
@@ -10,12 +10,15 @@ const labelCls = "flex flex-col gap-[0.35rem] text-[0.9rem] font-semibold text-[
|
||||
const inputCls = "px-[0.85rem] py-[0.6rem] border border-[#ddd] rounded-lg text-base outline-none transition-all focus:border-[#e68672] focus:shadow-[0_0_0_3px_rgba(230,134,114,0.2)]";
|
||||
const submitBtnCls = "mt-2 py-3 bg-[#e68672] text-white border-none rounded-lg text-base font-bold cursor-pointer transition-all hover:bg-[#d4705e] active:scale-[0.98] disabled:opacity-60 disabled:cursor-not-allowed";
|
||||
|
||||
//Returns the redirect path after login, blocking open redirects to external or auth pages
|
||||
function resolveNextPath(candidate) {
|
||||
if (!candidate || !candidate.startsWith("/")) return "/";
|
||||
if (candidate.startsWith("//") || candidate.startsWith("/login") || candidate.startsWith("/register")) return "/";
|
||||
return candidate;
|
||||
}
|
||||
|
||||
//Login page
|
||||
//Username and password form, redirects to the page the user was trying to visit
|
||||
function LoginPage() {
|
||||
const {login} = useAuth();
|
||||
const router = useRouter();
|
||||
@@ -26,6 +29,7 @@ function LoginPage() {
|
||||
const [error, setError] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
//Submits the login form and redirects on success
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
setError("");
|
||||
|
||||
Reference in New Issue
Block a user