feat: persist pilot monitoring selection

This commit is contained in:
Remi
2025-09-18 19:39:06 +02:00
committed by itsrubberduck
parent 8ea2ae28d2
commit b8e36ad556
3 changed files with 91 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
import { defineNuxtPlugin } from '#app'
import { useAuthStore, AUTH_TOKEN_STORAGE_KEY } from '~/stores/auth'
export default defineNuxtPlugin(() => {
if (typeof window === 'undefined') {
return
}
const auth = useAuthStore()
const storedToken = window.localStorage.getItem(AUTH_TOKEN_STORAGE_KEY)
if (storedToken && auth.accessToken !== storedToken) {
auth.setAccessToken(storedToken)
}
})