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