feat: support http basic auth

This commit is contained in:
dec0dOS 2022-06-18 14:55:33 +03:00
parent cd0276e598
commit 2396e973dc
2 changed files with 13 additions and 10 deletions

View file

@ -13,7 +13,9 @@ function HomeLoggedOut() {
useEffect(() => {
async function fetchData() {
axios.get("/auth/login").then(function (response) {
axios
.get("/auth/login", { withCredentials: true })
.then(function (response) {
if (!response.data.enabled) {
setLoggedIn(true);
setDisableAuth(true);

View file

@ -5,6 +5,7 @@ const baseURL = "/api/";
export default axios.create({
baseURL: baseURL,
responseType: "json",
withCredentials: "true",
headers:
localStorage.getItem("disableAuth") === "true"
? {}