refactor: enhance authentication and signup flow with new providers, update middleware matcher, and improve type safety for API responses

This commit is contained in:
2025-03-26 22:48:14 +05:00
parent 32bb01b656
commit 99c5fef748
14 changed files with 222 additions and 78 deletions

View File

@ -1,4 +1,6 @@
import SignUpForm from "@/components/auth/signup-form";
import type { ApiResponse, Atoll, Island } from "@/lib/backend-types";
import { getAtolls } from "@/queries/islands";
import Image from "next/image";
import { redirect } from "next/navigation";
@ -8,11 +10,10 @@ export default async function SignupPage({
searchParams: Promise<{ phone_number: string }>;
}) {
const atolls = await getAtollsWithIslands();
console.log(atolls.data);
const phone_number = (await searchParams).phone_number;
console.log({ phone_number })
if (!phone_number) {
return redirect("/login");
return redirect("/auth/login");
}
@ -26,7 +27,7 @@ export default async function SignupPage({
Pay for your devices and track your bills.
</p>
</div>
<SignUpForm atolls={atolls.data} />
<SignUpForm />
</div>
</div>
);