diff --git a/src/api/paths.ts b/src/api/paths.ts index 5dbc039..65293a5 100644 --- a/src/api/paths.ts +++ b/src/api/paths.ts @@ -1,8 +1,10 @@ export const backendDomain = process.env.REACT_APP_API_BASE_URL + "/"; export const spotifyPlaylistLinkPrefix = "https://open.spotify.com/playlist/"; -export const authLoginURL = backendDomain + "api/auth/login"; -export const authLogoutURL = backendDomain + "api/auth/logout"; +export const authLoginURL = "api/auth/login"; +export const authLoginFullURL = backendDomain + authLoginURL; +export const authLogoutURL = "api/auth/logout"; +export const authLogoutFullURL = backendDomain + authLogoutURL; export const authHealthCheckURL = "auth-health"; export const authRefreshURL = "api/auth/refresh"; diff --git a/src/pages/Login/index.tsx b/src/pages/Login/index.tsx index fd2f739..f9acae1 100644 --- a/src/pages/Login/index.tsx +++ b/src/pages/Login/index.tsx @@ -1,12 +1,12 @@ import React, { useEffect } from "react"; import styles from "./Login.module.css"; -import { authLoginURL } from "../../api/paths"; +import { authLoginFullURL } from "../../api/paths"; // auth through backend const Login = () => { useEffect(() => { const timeoutID = setTimeout(() => { - window.open(authLoginURL, "_self"); + window.open(authLoginFullURL, "_self"); }, 1000); return () => clearTimeout(timeoutID); diff --git a/src/pages/Logout/index.tsx b/src/pages/Logout/index.tsx index 47c5021..356fa4b 100644 --- a/src/pages/Logout/index.tsx +++ b/src/pages/Logout/index.tsx @@ -1,11 +1,11 @@ import React, { useEffect } from "react"; import styles from "./Logout.module.css"; -import { authLogoutURL } from "../../api/paths"; +import { authLogoutFullURL } from "../../api/paths"; const Logout = () => { useEffect(() => { const timeoutID = setTimeout(() => { - window.open(authLogoutURL, "_self"); + window.open(authLogoutFullURL, "_self"); }, 1000); return () => clearTimeout(timeoutID);