convert endpoint urls to env variables
This commit is contained in:
parent
28dd929927
commit
00c14f4eeb
4 changed files with 9 additions and 5 deletions
|
|
@ -3,6 +3,8 @@ import "../scss/styles.scss";
|
|||
import "../scss/components/_navbar.scss";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
const authUrl = import.meta.env.VITE_AUTH_URL;
|
||||
|
||||
const Navbar = () => {
|
||||
const [glitchEffect, setGlitchEffect] = useState(false);
|
||||
const [activeLink, setActiveLink] = useState("/");
|
||||
|
|
@ -37,7 +39,7 @@ const Navbar = () => {
|
|||
|
||||
document.addEventListener("mousedown", handleClickOutside);
|
||||
async function fetchUser() {
|
||||
const res = await fetch("http://localhost:8080/auth/current_user", {
|
||||
const res = await fetch(`${authUrl}/auth/current_user`, {
|
||||
credentials: "include", // very important
|
||||
});
|
||||
if (res.ok) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue