You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chrome sidepanel doesn't persist state in the background, every time we close/open sidepanel it loses its previous state and restarts again. So we end up having to login everytime.
Screen.Recording.2024-05-06.at.8.29.23.AM.mov
Expected behavior
Ideally need to bypass login automatically and directly route to desired page
Technical inputs
One way could be to use our /verify route with authToken as query parameter, like /verify?authToken=.... similar to loginToken query parameter which is already present. We can get our authToken from chrome's storage, verify it on backend and return if its valid, then set the required state for the app to load and then redirect it to our desired route
The text was updated successfully, but these errors were encountered:
To resolve the issue of the user having to re-login every time the Chrome sidepanel opens, you can implement a solution that checks for an existing authentication token in Chrome's storage and uses it to verify the user's session automatically. Here are the specific steps to implement this solution:
Modify the Background Script (/packages/twenty-chrome-extension/src/background/index.ts):
Add a function to check for an existing authToken in Chrome's storage upon opening the sidepanel.
If an authToken exists, use it to make a request to the /verify endpoint to validate the token.
Based on the verification response, automatically set the user's authentication state in the extension.
Update the Content Script (/packages/twenty-chrome-extension/src/contentScript/index.ts):
Adjust the authenticated function to check for an authToken instead of a loginToken.
If the token is valid, directly load the user's desired page without requiring a login.
Adjust the Options Page Script (/packages/twenty-chrome-extension/src/options/Options.tsx):
Ensure that the authentication flow considers the presence of an authToken to bypass the login screen if the token is valid.
By implementing these changes, the extension will be able to maintain the user's authentication state across sidepanel sessions, eliminating the need for repeated logins.
Bug Description
Chrome sidepanel doesn't persist state in the background, every time we close/open sidepanel it loses its previous state and restarts again. So we end up having to login everytime.
Screen.Recording.2024-05-06.at.8.29.23.AM.mov
Expected behavior
Ideally need to bypass login automatically and directly route to desired page
Technical inputs
One way could be to use our
/verify
route withauthToken
as query parameter, like/verify?authToken=....
similar tologinToken
query parameter which is already present. We can get our authToken from chrome's storage, verify it on backend and return if its valid, then set the required state for the app to load and then redirect it to our desired routeThe text was updated successfully, but these errors were encountered: