mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-04 09:25:16 -05:00
fix: Remove Auth Refresh (#6646)
This commit is contained in:
@@ -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),
|
||||||
@@ -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 () {
|
||||||
Reference in New Issue
Block a user