ktvmanager/client/src/checkAuth.js
karl.hudgell d05d37e4f9 latest
2021-03-12 13:56:26 +00:00

19 lines
336 B
JavaScript

import axios from "axios";
async function readCookie() {
try {
const res = await axios.get("/readCookie");
console.log('IM CHECKING AUTH')
if (res.data === "No Cookie Set") {
console.log('I CHECKED AUTH')
document.location = "/";
}
} catch (e) {
console.log(e);
}
};
export default readCookie;