Skip to content

Commit

Permalink
Prepend API calls with subdirectory path
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 authored Feb 4, 2021
1 parent 7cac01a commit 1a84209
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/auth/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function login(username, password){
body: JSON.stringify({ "username": username, "password": password})
};

let loginResponse = await fetch("/api/login", loginInit);
let loginResponse = await fetch(`${process.env.PUBLIC_URL}/api/login`, loginInit);
let data = await loginResponse.json();

if (data === null){
Expand All @@ -44,7 +44,7 @@ export async function refresh(csrf_refresh_token){
headers: {'X-CSRF-TOKEN': csrf_refresh_token},
};

let refreshResponse = await fetch("/api/tokens/refresh", refreshInit);
let refreshResponse = await fetch(`${process.env.PUBLIC_URL}/api/tokens/refresh`, refreshInit);
let data = await refreshResponse.json();

if (data === null){
Expand All @@ -56,4 +56,4 @@ export async function refresh(csrf_refresh_token){
}

return data.access_token || false;
}
}

0 comments on commit 1a84209

Please sign in to comment.