Selaa lähdekoodia

Remove extra calls to isAuthenticated (#4766)

Robert Brennan 1 vuosi sitten
vanhempi
sitoutus
e497438085
1 muutettua tiedostoa jossa 1 lisäystä ja 13 poistoa
  1. 1 13
      frontend/src/routes/_oh.app.tsx

+ 1 - 13
frontend/src/routes/_oh.app.tsx

@@ -7,7 +7,6 @@ import {
   json,
   ClientActionFunctionArgs,
   useRouteLoaderData,
-  redirect,
 } from "@remix-run/react";
 import { useDispatch, useSelector } from "react-redux";
 import WebSocket from "ws";
@@ -47,8 +46,6 @@ import { base64ToBlob } from "#/utils/base64-to-blob";
 import { clientLoader as rootClientLoader } from "#/routes/_oh";
 import { clearJupyter } from "#/state/jupyterSlice";
 import { FilesProvider } from "#/context/files";
-import { clearSession } from "#/utils/clear-session";
-import { userIsAuthenticated } from "#/utils/user-is-authenticated";
 import { ErrorObservation } from "#/types/core/observations";
 import { ChatInterface } from "#/components/chat-interface";
 
@@ -72,16 +69,6 @@ const isAgentStateChange = (
 
 export const clientLoader = async () => {
   const ghToken = localStorage.getItem("ghToken");
-  try {
-    const isAuthed = await userIsAuthenticated();
-    if (!isAuthed) {
-      clearSession();
-      return redirect("/");
-    }
-  } catch (error) {
-    clearSession();
-    return redirect("/");
-  }
 
   const q = store.getState().initalQuery.initialQuery;
   const repo =
@@ -127,6 +114,7 @@ export const clientAction = async ({ request }: ClientActionFunctionArgs) => {
 };
 
 function App() {
+  console.log("render app");
   const dispatch = useDispatch();
   const { files, importedProjectZip } = useSelector(
     (state: RootState) => state.initalQuery,