2025-04-28 12:39:32 +02:00
|
|
|
<template>
|
2025-04-29 13:10:30 +02:00
|
|
|
<BaseSetting title="Login-Session Einstellungen" :submit-function="submit" v-slot="{ enableEdit }">
|
|
|
|
<div class="w-full">
|
|
|
|
<label for="jwt_expiration">JWT-Gültigkeitsdauer (optional)</label>
|
|
|
|
<input
|
|
|
|
id="jwt_expiration"
|
|
|
|
type="text"
|
|
|
|
:readonly="!enableEdit"
|
|
|
|
:value="sessionSettings['session.jwt_expiration']"
|
|
|
|
/>
|
2025-04-28 12:39:32 +02:00
|
|
|
</div>
|
2025-04-29 13:10:30 +02:00
|
|
|
<div class="w-full">
|
|
|
|
<label for="refresh_expiration">Session-Gültigkeitsdauer (optional)</label>
|
|
|
|
<input
|
|
|
|
id="refresh_expiration"
|
|
|
|
type="text"
|
|
|
|
:readonly="!enableEdit"
|
|
|
|
:value="sessionSettings['session.refresh_expiration']"
|
|
|
|
/>
|
2025-04-28 12:39:32 +02:00
|
|
|
</div>
|
2025-04-29 13:10:30 +02:00
|
|
|
<div class="w-full">
|
|
|
|
<label for="pwa_refresh_expiration">Sesion-Gültigkeitsdauer PWA (optional)</label>
|
|
|
|
<input
|
|
|
|
id="pwa_refresh_expiration"
|
|
|
|
type="text"
|
|
|
|
:readonly="!enableEdit"
|
|
|
|
:value="sessionSettings['session.pwa_refresh_expiration']"
|
|
|
|
/></div
|
|
|
|
></BaseSetting>
|
2025-04-28 12:39:32 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-04-29 13:10:30 +02:00
|
|
|
import { useAbilityStore } from "@/stores/ability";
|
2025-04-28 14:36:47 +02:00
|
|
|
import { useSettingStore } from "@/stores/admin/management/setting";
|
2025-04-29 13:10:30 +02:00
|
|
|
import { mapActions, mapState } from "pinia";
|
2025-04-28 12:39:32 +02:00
|
|
|
import { defineComponent } from "vue";
|
2025-04-29 13:10:30 +02:00
|
|
|
import BaseSetting from "./BaseSetting.vue";
|
2025-04-28 12:39:32 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2025-04-28 14:36:47 +02:00
|
|
|
export default defineComponent({
|
2025-04-29 13:10:30 +02:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
enableEdit: false as boolean,
|
|
|
|
status: undefined as undefined | "loading" | "success" | "failed",
|
|
|
|
};
|
|
|
|
},
|
2025-04-28 14:36:47 +02:00
|
|
|
computed: {
|
|
|
|
...mapState(useSettingStore, ["readByTopic"]),
|
2025-04-29 13:10:30 +02:00
|
|
|
...mapState(useAbilityStore, ["can"]),
|
2025-04-28 14:36:47 +02:00
|
|
|
sessionSettings() {
|
|
|
|
return this.readByTopic("session");
|
|
|
|
},
|
|
|
|
},
|
2025-04-29 13:10:30 +02:00
|
|
|
methods: {
|
|
|
|
...mapActions(useSettingStore, ["updateSettings"]),
|
|
|
|
submit(e: any) {
|
|
|
|
const formData = e.target.elements;
|
|
|
|
return this.updateSettings([
|
|
|
|
{
|
|
|
|
key: "session.jwt_expiration",
|
|
|
|
value: formData.jwt_expiration.value || null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "session.refresh_expiration",
|
|
|
|
value: formData.refresh_expiration.value || null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "session.pwa_refresh_expiration",
|
|
|
|
value: formData.pwa_refresh_expiration.value || null,
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
},
|
2025-04-28 14:36:47 +02:00
|
|
|
});
|
2025-04-28 12:39:32 +02:00
|
|
|
</script>
|