feat(fullstack): Read user out of JWT and persist with created and last modified

This commit is contained in:
2025-05-01 09:20:32 +02:00
parent aaea7d3b28
commit aee88ad261
14 changed files with 129 additions and 147 deletions

View File

@@ -62,7 +62,7 @@ const applicationForm = computed({
})
const isReadOnly = computed(() => {
return applicationForm.value?.createdBy !== user.value?.name
return applicationForm.value?.createdBy.id !== user.value?.id
})
async function onSubmit() {

View File

@@ -31,11 +31,11 @@
#{{ index }} {{ applicationFormElem.name }}
</p>
<p class="text-(--ui-text-muted) text-sm">
Zuletzt bearbeitet von {{ applicationFormElem.lastModifiedBy }} am
Zuletzt bearbeitet von {{ applicationFormElem.lastModifiedBy.name }} am
{{ formatDate(applicationFormElem.modifiedAt) }}
</p>
<p class="text-(--ui-text-muted) text-sm">
Erstellt von {{ applicationFormElem.createdBy }} am {{ formatDate(applicationFormElem.createdAt) }}
Erstellt von {{ applicationFormElem.createdBy.name }} am {{ formatDate(applicationFormElem.createdAt) }}
</p>
</div>
<div>

View File

@@ -9,7 +9,8 @@ export const auth = betterAuth({
plugins: [
jwt({
jwt: {
issuer: 'http://192.168.178.105:3001'
issuer: 'http://192.168.178.105:3001',
expirationTime: '48h'
},
jwks: {
keyPairConfig: {