From eb15bc5e8023151d27d85a613c2024516cee76c7 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 1 Feb 2025 01:19:13 +0100 Subject: [PATCH] Cosmetic --- public/styles.css | 10 +++++++++- src/App.vue | 15 +++++++++++---- vite.config.ts | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) 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) {
{{ key }}
-
{{ value }}
+
{{ value }}
+
{{ value }}
+
{{ msg }}

@@ -80,7 +87,7 @@ async function get_resource(id: string) {

idToken

-
{{ key }}
+
{{ key }}
{{ value }}
diff --git a/vite.config.ts b/vite.config.ts index b9462f0..9b20b48 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -32,6 +32,7 @@ let baseSettings: UserConfig = { if (env.VITE_SSL_CERT && env.VITE_SSL_KEY) { baseSettings['server'] = { + hmr: false, https: { key: fs.readFileSync(path.resolve(env.VITE_SSL_KEY)), cert: fs.readFileSync(path.resolve(env.VITE_SSL_CERT))