fix: invalidate tanstack caches on user auth (#5341)

* fix: invalidate tanstack caches on user auth

* refactor: clean up invalidate flow

* fix: lint
This commit is contained in:
Calum H.
2026-02-09 14:43:33 +00:00
committed by GitHub
parent e962521492
commit 90438a1ad5
16 changed files with 105 additions and 198 deletions

View File

@@ -1,6 +1,7 @@
import type { AbstractModrinthClient } from '@modrinth/api-client'
const STALE_TIME = 1000 * 60 * 5 // 5 minutes
export const STALE_TIME = 1000 * 60 * 5 // 5 minutes
export const STALE_TIME_LONG = 1000 * 60 * 10 // 10 minutes
export const projectQueryOptions = {
v2: (projectId: string, client: AbstractModrinthClient) => ({

View File

@@ -1,3 +1,5 @@
import { useAppQueryClient } from '@/composables/query-client'
export const useUser = async (force = false) => {
const user = useState('user', () => {})
@@ -158,5 +160,6 @@ export const logout = async () => {
await useAuth('none')
useCookie('auth-token').value = null
useAppQueryClient().clear()
stopLoading()
}