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:
@@ -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) => ({
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user