fix javascript error when click on 'Show Expires' and token is not active
This commit is contained in:
parent
d1c890db18
commit
9beb210c23
1 changed files with 5 additions and 0 deletions
|
@ -48,6 +48,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function showExpires() {
|
function showExpires() {
|
||||||
|
if (!keycloak.tokenParsed) {
|
||||||
|
output("Not authenticated");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var o = 'Token Expires:\t\t' + new Date(keycloak.tokenParsed.exp * 1000).toLocaleString() + '\n';
|
var o = 'Token Expires:\t\t' + new Date(keycloak.tokenParsed.exp * 1000).toLocaleString() + '\n';
|
||||||
o += 'Token Expires in:\t' + Math.round(keycloak.tokenParsed.exp - new Date().getTime() / 1000) + ' seconds\n';
|
o += 'Token Expires in:\t' + Math.round(keycloak.tokenParsed.exp - new Date().getTime() / 1000) + ' seconds\n';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue