24 lines
619 B
HTML
24 lines
619 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Index</title>
|
|
<script src="./cookies.js"></script>
|
|
<script src="./jwt.js"></script>
|
|
<script>
|
|
const token = cookieEater("accessToken");
|
|
let authed = false;
|
|
try {
|
|
if (token) {
|
|
const res = jwtDecode(token);
|
|
authed = new Date().valueOf() / 1000 < res.payload.exp;
|
|
}
|
|
} catch (e) { /* stale or malformed token */ }
|
|
window.location.replace(authed ? "./notes.html" : "./auth.html");
|
|
</script>
|
|
</head>
|
|
<body>
|
|
</body>
|
|
</html>
|