diff --git a/public/styles.css b/public/styles.css index 06d40a8..17d7c4c 100644 --- a/public/styles.css +++ b/public/styles.css @@ -146,7 +146,6 @@ hr { max-width: 13em; } .providers .error { - color: darkred; padding: 3px 6px; text-align: center; font-weight: bold; @@ -198,6 +197,10 @@ hr { text-align: center; } +.error { + color: darkred; +} + .from-keycloak-vue { margin: 0 1em; } @@ -212,3 +215,8 @@ hr { .token .value { padding-left: 1em; } + +.msg { + text-align: center; + font-weight: bold; +} diff --git a/src/App.vue b/src/App.vue index b541802..fc161f9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,6 +5,7 @@ import { useKeycloak } from '@dsb-norge/vue-keycloak-js' let resource = ref({}) const keycloak = useKeycloak() +let msg = ref("") function manuallyRefreshAccessToken() { // We set a high minValidity to force a token refresh @@ -27,9 +28,13 @@ function accountManagemnt() { async function get_resource(id: string) { if (!keycloak.keycloak) { return } - await keycloak.keycloak.updateToken(5000) await resourceServer.get(id).then( - resp => resource.value = resp['data'] + resp => { + resource.value = resp['data'] + msg.value = "" + } + ).catch( + err => msg.value = err ) } @@ -69,10 +74,12 @@ async function get_resource(id: string) {