fix(FE) : update refresh token

This commit is contained in:
Yusron alamsyah
2026-02-18 14:27:54 +07:00
parent a24a5f8f01
commit 6ec4a9758c
4 changed files with 17 additions and 4 deletions
+5 -3
View File
@@ -29,14 +29,16 @@ export const useAuth = () => {
accessToken.value = response.accessToken || null
// Store tokens to localStorage for API interceptor (only on client-side)
// Only update if localStorage is empty to avoid overwriting refreshed tokens
if (process.client) {
if (response.idToken) {
// Only set tokens if they don't exist yet (avoid overwriting refreshed tokens)
if (!localStorage.getItem('idToken') && response.idToken) {
localStorage.setItem('idToken', response.idToken)
}
if (response.accessToken) {
if (!localStorage.getItem('accessToken') && response.accessToken) {
localStorage.setItem('accessToken', response.accessToken)
}
if (response.refreshToken) {
if (!localStorage.getItem('refreshToken') && response.refreshToken) {
localStorage.setItem('refreshToken', response.refreshToken)
}
}
+11
View File
@@ -20,5 +20,16 @@
"view-profile"
],
"status": "aktif"
},
{
"id": "31e5227f-78d2-4b4d-b255-afcc5ece6b27",
"namaUser": "renaldy",
"email": "renaldy.brada@gmail.com",
"hakAkses": [
"manage-account",
"manage-account-links",
"view-profile"
],
"status": "aktif"
}
]
+1 -1
View File
@@ -10,7 +10,7 @@ export default defineNuxtConfig({
{ name: "format-detection", content: "telephone=no" }
],
link: [
{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
{ rel: "icon", type: "image/x-icon", href: "/favicon3.ico" },
{
rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap"
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB