From 174cc94b42e34fc9c4e75998c1c4debae48cd939 Mon Sep 17 00:00:00 2001 From: poduck Date: Mon, 29 Dec 2025 21:23:32 -0500 Subject: [PATCH] Fix TypeScript error in authenticate route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add saveToken() method to authenticationSession for saving standalone JWT tokens without requiring a full AuthenticationResponse object. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../react-ui/src/app/routes/authenticate/index.tsx | 2 +- .../packages/react-ui/src/lib/authentication-session.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/activepieces-fork/packages/react-ui/src/app/routes/authenticate/index.tsx b/activepieces-fork/packages/react-ui/src/app/routes/authenticate/index.tsx index f830e710..95057530 100644 --- a/activepieces-fork/packages/react-ui/src/app/routes/authenticate/index.tsx +++ b/activepieces-fork/packages/react-ui/src/app/routes/authenticate/index.tsx @@ -21,7 +21,7 @@ const AuthenticatePage = () => { } else if (token) { // Handle standalone JWT token (from embedded mode new tab) // Save token directly to localStorage for persistence in new tabs - authenticationSession.saveResponse({ token }, false); + authenticationSession.saveToken(token); navigate(redirectTo); } }, [response, token, redirectTo, navigate]); diff --git a/activepieces-fork/packages/react-ui/src/lib/authentication-session.ts b/activepieces-fork/packages/react-ui/src/lib/authentication-session.ts index 3fef509a..7d1cfc84 100644 --- a/activepieces-fork/packages/react-ui/src/lib/authentication-session.ts +++ b/activepieces-fork/packages/react-ui/src/lib/authentication-session.ts @@ -19,6 +19,14 @@ export const authenticationSession = { ApStorage.getInstance().setItem(tokenKey, response.token); window.dispatchEvent(new Event('storage')); }, + /** + * Save a standalone JWT token directly. + * Used for auto-authentication when opening new tabs from embedded mode. + */ + saveToken(token: string) { + ApStorage.getInstance().setItem(tokenKey, token); + window.dispatchEvent(new Event('storage')); + }, isJwtExpired(token: string): boolean { if (!token) { return true;