diff --git a/server/environment.ts b/server/environment.ts index b8353b10..ab573b99 100644 --- a/server/environment.ts +++ b/server/environment.ts @@ -44,7 +44,7 @@ const environmentSchema = z.object({ EMAIL_SMTP_USER: z.string().optional(), EMAIL_SMTP_PASS: z.string().optional(), EMAIL_NOREPLY: z.string().email().optional(), - SITE_DOMAIN: z + BASE_URL: z .string() .optional() .transform((val) => { @@ -73,7 +73,7 @@ const environment = { EMAIL_SMTP_USER: process.env.EMAIL_SMTP_USER as string, EMAIL_SMTP_PASS: process.env.EMAIL_SMTP_PASS as string, EMAIL_NOREPLY: process.env.EMAIL_NOREPLY as string, - SITE_DOMAIN: process.env.NEXT_PUBLIC_SITE_DOMAIN as string, + BASE_URL: process.env.BASE_URL as string, }; const parsedConfig = environmentSchema.safeParse(environment); diff --git a/src/api/index.ts b/src/api/index.ts index dac704e5..30e2e5b8 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,7 +1,9 @@ import axios from "axios"; +const baseURL = `${window.location.protocol}//${window.location.host}/api/v1`; + export const api = axios.create({ - baseURL: `http://${process.env.NEXT_PUBLIC_SITE_DOMAIN || "localhost:3000"}/api/v1`, + baseURL, timeout: 10000, headers: { "Content-Type": "application/json", diff --git a/src/app/auth/login/page.tsx b/src/app/auth/login/page.tsx index 964d02be..8f27333c 100644 --- a/src/app/auth/login/page.tsx +++ b/src/app/auth/login/page.tsx @@ -24,8 +24,8 @@ import { } from "@/components/ui/card"; import { Alert, AlertDescription } from "@/components/ui/alert"; import { ExclamationTriangleIcon } from "@radix-ui/react-icons"; -import api from "@app/api"; -import { LoginBody, LoginResponse } from "@server/routers/auth"; +import { LoginResponse } from "@server/routers/auth"; +import { api } from "@app/api"; const formSchema = z.object({ email: z.string().email({ message: "Invalid email address" }), @@ -48,7 +48,7 @@ export default function LoginForm() { async function onSubmit(values: z.infer) { const { email, password } = values; const res = await api - .post("/auth/login", { + .post("/auth/login", { email, password, }) diff --git a/src/app/globals.css b/src/app/globals.css index b3a6afb2..bd82533c 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -3,47 +3,47 @@ @tailwind utilities; @layer base { :root { - --background: 31 100% 100%; - --foreground: 31 5% 10%; - --card: 31 50% 100%; - --card-foreground: 31 5% 15%; - --popover: 31 100% 100%; - --popover-foreground: 31 100% 10%; - --primary: 31 11% 28%; + --background: 37 100% 100%; + --foreground: 37 5% 10%; + --card: 37 50% 100%; + --card-foreground: 37 5% 15%; + --popover: 37 100% 100%; + --popover-foreground: 37 100% 10%; + --primary: 37 8% 51%; --primary-foreground: 0 0% 100%; - --secondary: 31 30% 90%; + --secondary: 37 30% 90%; --secondary-foreground: 0 0% 0%; - --muted: -7 30% 95%; - --muted-foreground: 31 5% 40%; - --accent: -7 30% 90%; - --accent-foreground: 31 5% 15%; + --muted: -1 30% 95%; + --muted-foreground: 37 5% 40%; + --accent: -1 30% 90%; + --accent-foreground: 37 5% 15%; --destructive: 0 100% 50%; - --destructive-foreground: 31 5% 100%; - --border: 31 30% 82%; - --input: 31 30% 50%; - --ring: 31 11% 28%; + --destructive-foreground: 37 5% 100%; + --border: 37 30% 82%; + --input: 37 30% 50%; + --ring: 37 8% 51%; --radius: 0rem; } .dark { - --background: 31 50% 10%; - --foreground: 31 5% 100%; - --card: 31 50% 10%; - --card-foreground: 31 5% 100%; - --popover: 31 50% 5%; - --popover-foreground: 31 5% 100%; - --primary: 31 11% 28%; + --background: 37 50% 10%; + --foreground: 37 5% 100%; + --card: 37 50% 10%; + --card-foreground: 37 5% 100%; + --popover: 37 50% 5%; + --popover-foreground: 37 5% 100%; + --primary: 37 8% 51%; --primary-foreground: 0 0% 100%; - --secondary: 31 30% 20%; + --secondary: 37 30% 20%; --secondary-foreground: 0 0% 100%; - --muted: -7 30% 25%; - --muted-foreground: 31 5% 65%; - --accent: -7 30% 25%; - --accent-foreground: 31 5% 95%; + --muted: -1 30% 25%; + --muted-foreground: 37 5% 65%; + --accent: -1 30% 25%; + --accent-foreground: 37 5% 95%; --destructive: 0 100% 50%; - --destructive-foreground: 31 5% 100%; - --border: 31 30% 50%; - --input: 31 30% 50%; - --ring: 31 11% 28%; + --destructive-foreground: 37 5% 100%; + --border: 37 30% 50%; + --input: 37 30% 50%; + --ring: 37 8% 51%; --radius: 0rem; } }