fix: Remove Auth Refresh (#6646)

This commit is contained in:
Michael Genson
2025-12-02 15:55:01 -06:00
committed by GitHub
parent b09a85dfab
commit fdd3d4b37a
2 changed files with 1 additions and 25 deletions

View File

@@ -120,30 +120,6 @@ export const useAuthBackend = function (): AuthState {
} }
} }
// Auto-refresh user data periodically when authenticated
if (import.meta.client) {
let refreshInterval: NodeJS.Timeout | null = null;
watch(() => authStatus.value, (status) => {
if (status === "authenticated") {
refreshInterval = setInterval(() => {
if (tokenCookie.value) {
getSession().catch(() => {
// Ignore errors in background refresh
});
}
}, 5 * 60 * 1000); // 5 minutes
}
else {
// Clear interval when not authenticated
if (refreshInterval) {
clearInterval(refreshInterval);
refreshInterval = null;
}
}
}, { immediate: true });
}
return { return {
data: computed(() => authUser.value), data: computed(() => authUser.value),
status: computed(() => authStatus.value), status: computed(() => authStatus.value),

View File

@@ -1,5 +1,5 @@
import { ref, watch, computed } from "vue"; import { ref, watch, computed } from "vue";
import { useAuthBackend } from "~/composables/useAuthBackend"; import { useAuthBackend } from "~/composables/use-auth-backend";
import type { UserOut } from "~/lib/api/types/user"; import type { UserOut } from "~/lib/api/types/user";
export const useMealieAuth = function () { export const useMealieAuth = function () {