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;