env context and refactor api support different ports

This commit is contained in:
Milo Schwartz 2024-12-12 22:46:58 -05:00
parent d79760dad9
commit d3d2fe398b
No known key found for this signature in database
35 changed files with 287 additions and 135 deletions

View file

@ -27,7 +27,6 @@ import {
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp";
import api from "@app/api";
import { AxiosResponse } from "axios";
import { VerifyEmailResponse } from "@server/routers/auth";
import { Loader2 } from "lucide-react";
@ -35,6 +34,8 @@ import { Alert, AlertDescription } from "../../../components/ui/alert";
import { useToast } from "@app/hooks/useToast";
import { useRouter } from "next/navigation";
import { formatAxiosError } from "@app/lib/utils";
import { createApiClient } from "@app/api";
import { useEnvContext } from "@app/hooks/useEnvContext";
const FormSchema = z.object({
email: z.string().email({ message: "Invalid email address" }),
@ -61,6 +62,8 @@ export default function VerifyEmailForm({
const { toast } = useToast();
const api = createApiClient(useEnvContext());
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
defaultValues: {