mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
fix(zero):refresh authenticated zero context
This commit is contained in:
parent
c8ac7d3fa6
commit
0ef8a0f2c9
3 changed files with 26 additions and 19 deletions
|
|
@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
|
|||
import { USER_QUERY_KEY } from "@/atoms/user/user-query.atoms";
|
||||
import { useGlobalLoadingEffect } from "@/hooks/use-global-loading";
|
||||
import { useSession } from "@/hooks/use-session";
|
||||
import { ensureTokensFromElectron, redirectToLogin } from "@/lib/auth-utils";
|
||||
import { redirectToLogin } from "@/lib/auth-utils";
|
||||
import { queryClient } from "@/lib/query-client/client";
|
||||
|
||||
export function DashboardShell({ children }: { children: React.ReactNode }) {
|
||||
|
|
@ -16,9 +16,6 @@ export function DashboardShell({ children }: { children: React.ReactNode }) {
|
|||
|
||||
useEffect(() => {
|
||||
async function checkAuth() {
|
||||
if (typeof window !== "undefined" && window.electronAPI) {
|
||||
await ensureTokensFromElectron();
|
||||
}
|
||||
if (session.status === "loading") return;
|
||||
if (session.status === "unauthenticated") {
|
||||
redirectToLogin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue