Cosmetic
Some checks failed
/ build (push) Failing after 8s

This commit is contained in:
phil 2025-02-01 01:19:13 +01:00
parent 8c695b9b67
commit eb15bc5e80
3 changed files with 21 additions and 5 deletions

View file

@ -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
)
}
</script>
@ -69,10 +74,12 @@ async function get_resource(id: string) {
<div v-if="Object.entries(resource).length > 0" class="resource">
<div v-for="(value, key) in resource">
<div class="key">{{ key }}</div>
<div class="value">{{ value }}</div>
<div v-if="key == 'sorry' || key == 'error'" class="error">{{ value }}</div>
<div v-else class="value">{{ value }}</div>
</div>
</div>
</div>
<div v-if="msg" class="msg resource">{{ msg }}</div>
<div v-if="settings.tokenSandbox" class="from-keycloak-vue">
<hr>
<button @click="manuallyRefreshAccessToken">Refresh access token</button>
@ -80,7 +87,7 @@ async function get_resource(id: string) {
<h2>idToken</h2>
<div class="token">
<div v-for="(value, key) in keycloak.idTokenParsed">
<div class=" key">{{ key }}</div>
<div class="key">{{ key }}</div>
<div class="value">{{ value }}</div>
</div>
</div>