diff --git a/packages/ui/src/hooks/use-social-callback-handler.ts b/packages/ui/src/hooks/use-social-callback-handler.ts index 47ab95b84..27239ecf8 100644 --- a/packages/ui/src/hooks/use-social-callback-handler.ts +++ b/packages/ui/src/hooks/use-social-callback-handler.ts @@ -1,7 +1,10 @@ import { useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; -import { getCallbackLinkFromStorage } from '@/utils/social-connectors'; +import { + getCallbackLinkFromStorage, + removeCallbackLinkFromStorage, +} from '@/utils/social-connectors'; const useSocialCallbackHandler = () => { const navigate = useNavigate(); @@ -19,6 +22,7 @@ const useSocialCallbackHandler = () => { // Get native callback link from storage const callbackLink = getCallbackLinkFromStorage(connectorId); + removeCallbackLinkFromStorage(connectorId); if (callbackLink) { window.location.replace(new URL(`${callbackLink}${search}`)); diff --git a/packages/ui/src/utils/social-connectors.ts b/packages/ui/src/utils/social-connectors.ts index df31e6ebb..d9d9d607a 100644 --- a/packages/ui/src/utils/social-connectors.ts +++ b/packages/ui/src/utils/social-connectors.ts @@ -56,6 +56,10 @@ export const getCallbackLinkFromStorage = (connectorId: string) => { return sessionStorage.getItem(`${storageCallbackLinkKeyPrefix}:${connectorId}`); }; +export const removeCallbackLinkFromStorage = (connectorId: string) => { + sessionStorage.removeItem(`${storageCallbackLinkKeyPrefix}:${connectorId}`); +}; + /** * Social Connectors Filter Utility Methods */