Initial import: KeepNote service (dcntrlized-auth consumer)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user