diff --git a/apps/client/app/(beforeLogin)/auth/_components/LoginButton.tsx b/apps/client/app/(beforeLogin)/auth/_components/LoginButton.tsx index 27774393..8a6fd7ae 100644 --- a/apps/client/app/(beforeLogin)/auth/_components/LoginButton.tsx +++ b/apps/client/app/(beforeLogin)/auth/_components/LoginButton.tsx @@ -1,5 +1,6 @@ "use client"; +import { baseUrl } from "constants/environment"; import Image from "next/image"; import { useRouter } from "next/navigation"; import { color } from "wowds-tokens"; @@ -9,11 +10,6 @@ const LoginButton = () => { const router = useRouter(); const handleClickLogin = () => { - const baseUrl = - process.env.NODE_ENV === "production" - ? process.env.NEXT_PUBLIC_PROD_BASE_URL - : process.env.NEXT_PUBLIC_DEV_BASE_URL; - router.push(`${baseUrl}/oauth2/authorization/github`); }; diff --git a/apps/client/constants/environment.ts b/apps/client/constants/environment.ts new file mode 100644 index 00000000..52f489f3 --- /dev/null +++ b/apps/client/constants/environment.ts @@ -0,0 +1,4 @@ +export const baseUrl = + process.env.NODE_ENV === "production" + ? process.env.NEXT_PUBLIC_PROD_BASE_URL + : process.env.NEXT_PUBLIC_DEV_BASE_URL;