2021-02-27 10:56:38 +00:00
|
|
|
import axios from "axios";
|
|
|
|
|
|
|
|
async function readCookie() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
const res = await axios.get("/readCookie");
|
2021-03-12 13:56:26 +00:00
|
|
|
console.log('IM CHECKING AUTH')
|
2021-02-27 10:56:38 +00:00
|
|
|
if (res.data === "No Cookie Set") {
|
2021-03-12 13:56:26 +00:00
|
|
|
console.log('I CHECKED AUTH')
|
2021-02-27 10:56:38 +00:00
|
|
|
document.location = "/";
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default readCookie;
|
|
|
|
|