ktvmanager/client/src/checkAuth.js

17 lines
264 B
JavaScript
Raw Normal View History

2021-02-27 10:56:38 +00:00
import axios from "axios";
async function readCookie() {
try {
const res = await axios.get("/readCookie");
if (res.data === "No Cookie Set") {
document.location = "/";
}
} catch (e) {
console.log(e);
}
};
export default readCookie;