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

@@ -149,10 +149,12 @@ import {
IntlFormatted,
useVIntl,
} from '@modrinth/ui'
import { useQueryClient } from '@tanstack/vue-query'
import HCaptcha from '@/components/ui/HCaptcha.vue'
import { getAuthUrl, getLauncherRedirectUrl } from '@/composables/auth.js'
const queryClient = useQueryClient()
const { addNotification } = injectNotificationManager()
const { formatMessage } = useVIntl()
@@ -306,6 +308,7 @@ async function finishSignIn(token) {
if (token) {
await useAuth(token)
await useUser()
queryClient.clear()
}
if (route.query.redirect) {

View File

@@ -57,7 +57,9 @@ import {
normalizeChildren,
useVIntl,
} from '@modrinth/ui'
import { useQueryClient } from '@tanstack/vue-query'
const queryClient = useQueryClient()
const route = useRoute()
const { formatMessage } = useVIntl()
@@ -96,6 +98,7 @@ const subscribe = ref(true)
onMounted(async () => {
await useAuth(route.query.authToken)
await useUser()
queryClient.clear()
})
async function continueSignUp() {