Remove token expiry counter

This commit is contained in:
Melon 2023-12-13 13:02:45 +00:00
parent 69f7b1a7c3
commit 716db16f37
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -1,29 +1,5 @@
<script lang="ts">
import {loginStore, parseJwt} from "../stores/login";
let tokenExp = 0;
let diffExp = 0;
loginStore.subscribe(x => {
if (!x) return;
let jwt = parseJwt(x?.tokens.access);
tokenExp = jwt.exp;
});
function timeDiff(exp: number) {
if (exp === 0) return 0;
return exp * 1000 - new Date().getTime();
}
setInterval(() => {
diffExp = timeDiff(tokenExp);
}, 500);
</script>
<div style="padding:8px;background-color:#bb7900;">Warning: This is currently still under development</div>
<div>
<a class="btn-green" href="https://uptime-kuma.1f349.com" target="_blank">Status Dashboard</a>
</div>
<div>{diffExp === 0 ? "No token" : diffExp}</div>