Skip to content

Commit

Permalink
UserMenu fetch path change
Browse files Browse the repository at this point in the history
  • Loading branch information
brandstetterm committed Jan 24, 2024
1 parent 94d983e commit 05d7431
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ type UserMenuProps = {
};

const UserMenu = ({germanLabel, englishLabel, loginLabel, logoutLabel}: UserMenuProps) => {
const serverUrl = import.meta.env.PUBLIC_SCRUMLR_SERVER_URL;

const [isActive, setIsActive] = useState(false);
const [isAuthenticated, setIsAuthenticated] = useState(false);

useEffect(() => {
fetch(`${serverUrl}/user`, {
fetch(`api/user`, {
method: "GET",
credentials: "include",
}).then((response) => {
Expand All @@ -35,7 +33,7 @@ const UserMenu = ({germanLabel, englishLabel, loginLabel, logoutLabel}: UserMenu
}, []);

const handleLogout = () => {
fetch(`${serverUrl}/login`, {
fetch(`api/login`, {
method: "DELETE",
credentials: "include",
}).then(() => {
Expand Down

0 comments on commit 05d7431

Please sign in to comment.