Skip to content

Commit

Permalink
tratando de arreglar el bug de login in con un parche en el login xd
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseCSG committed Jun 3, 2024
1 parent 4415fd4 commit f8d5247
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import { loginAction } from "@/actions";
import FormTextInput from "@/components/FormTextInput";
import Link from "next/link";
import { useRouter } from "next/navigation";
import toast from "react-hot-toast";

const Login = () => {
const router = useRouter();
const clientLoginAction = async (formData: FormData) => {
const result = await loginAction(formData);
if (result) {
Expand All @@ -16,6 +18,8 @@ const Login = () => {
toast.error("Something went wrong. Try again.");
break;
}
} else {
router.push("/dashboard");
}
};

Expand Down
2 changes: 1 addition & 1 deletion auth.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const authConfig = {
return Response.redirect(new URL("/forbbiden", nextUrl));
}
}

console.log("url actual", nextUrl.pathname);
if (
nextUrl.pathname.startsWith("/login") ||
nextUrl.pathname.startsWith("/register")
Expand Down

0 comments on commit f8d5247

Please sign in to comment.