From 7b9cf256312198677d7b7920916b0ee451e6c8f3 Mon Sep 17 00:00:00 2001 From: F4ilji Date: Sat, 4 Jul 2026 18:22:51 +0500 Subject: [PATCH] fix(vikon): skip authenticate call on OAuth callback, tokens already saved server-side --- resources/js/Pages/Dashboard/VikonUpdates/Index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/js/Pages/Dashboard/VikonUpdates/Index.vue b/resources/js/Pages/Dashboard/VikonUpdates/Index.vue index 18885ee..f91eda0 100644 --- a/resources/js/Pages/Dashboard/VikonUpdates/Index.vue +++ b/resources/js/Pages/Dashboard/VikonUpdates/Index.vue @@ -146,11 +146,14 @@ const authUrl = computed(() => { }); onMounted(() => { - const code = new URLSearchParams(window.location.search).get('code'); - if (code) { - authenticate(code); - return; + const url = new URL(window.location.href); + const isCallback = url.pathname.endsWith('/callback'); + const code = url.searchParams.get('code'); + + if (isCallback && code) { + window.history.replaceState({}, document.title, url.pathname); } + if (isAuthenticated.value) { checkAccess(); checkVersion();