From 0f6a74b87ffc834767a9b67311c9c43f2b0fdb6f Mon Sep 17 00:00:00 2001
From: Truman Gao <106889354+tdgao@users.noreply.github.com>
Date: Wed, 29 Jul 2026 06:44:30 -0600
Subject: [PATCH] fix: pats page code invalidating in same session (#6924)
---
apps/frontend/src/pages/settings/pats.vue | 24 ++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/apps/frontend/src/pages/settings/pats.vue b/apps/frontend/src/pages/settings/pats.vue
index 8441682a3..1fa084991 100644
--- a/apps/frontend/src/pages/settings/pats.vue
+++ b/apps/frontend/src/pages/settings/pats.vue
@@ -62,7 +62,13 @@
-
+
@@ -73,13 +79,13 @@
-
-
+
{{ formatMessage(createModalMessages.action) }}
@@ -123,8 +129,8 @@
{{ pat.name }}
-
-
+
+
@@ -331,12 +337,17 @@ useHead({
const data = useNuxtApp()
const { scopesToLabels } = useScopes()
const patModal = ref()
+const minimumPatExpiry = data.$dayjs().add(1, 'day').format('YYYY-MM-DD')
const editPatId = ref(null)
const name = ref(null)
const scopesVal = ref(BigInt(0))
const expires = ref(null)
+const createdPatTokens = ref({})
+const isExpiryInFuture = computed(
+ () => expires.value && data.$dayjs(expires.value).isAfter(data.$dayjs(), 'day'),
+)
const deletePatIndex = ref(null)
@@ -415,6 +426,9 @@ async function createPat() {
scopes: Number(scopesVal.value),
expires: data.$dayjs(expires.value).toISOString(),
})
+ if (res.access_token) {
+ createdPatTokens.value[res.id] = res.access_token
+ }
queryClient.setQueryData(['pat'], (old) => [...(old || []), res])
patModal.value.hide()
} catch (err) {