mirror of
https://github.com/1f349/admin.1f349.com.git
synced 2024-11-13 23:21:32 +00:00
Remove token expiry counter
This commit is contained in:
parent
69f7b1a7c3
commit
716db16f37
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user