@@ -20,8 +20,14 @@ import {
2020 useActiveWalletConnectionStatus ,
2121} from "thirdweb/react" ;
2222import { createWallet , inAppWallet } from "thirdweb/wallets" ;
23+ import {
24+ LAST_USED_PROJECT_ID ,
25+ LAST_USED_TEAM_ID ,
26+ } from "../../../constants/cookies" ;
27+ import { deleteCookie } from "../../../lib/cookie" ;
2328import { ThirdwebMiniLogo } from "../components/ThirdwebMiniLogo" ;
2429import { getSDKTheme } from "../components/sdk-component-theme" ;
30+ import { LAST_VISITED_TEAM_PAGE_PATH } from "../team/components/last-visited-page/consts" ;
2531import { doLogin , doLogout , getLoginPayload , isLoggedIn } from "./auth-actions" ;
2632import { isAccountOnboardingComplete } from "./onboarding/isOnboardingRequired" ;
2733
@@ -116,6 +122,8 @@ export function LoginAndOnboardingPage(props: {
116122 redirectPath = { props . redirectPath }
117123 loginWithInAppWallet = { props . loginWithInAppWallet }
118124 />
125+
126+ < ResetLastUsedCookies />
119127 </ div >
120128 ) ;
121129}
@@ -139,6 +147,16 @@ function LoginPageContainer(props: {
139147 ) ;
140148}
141149
150+ function ResetLastUsedCookies ( ) {
151+ // eslint-disable-next-line no-restricted-syntax
152+ useEffect ( ( ) => {
153+ deleteCookie ( LAST_USED_PROJECT_ID ) ;
154+ deleteCookie ( LAST_USED_TEAM_ID ) ;
155+ deleteCookie ( LAST_VISITED_TEAM_PAGE_PATH ) ;
156+ } , [ ] ) ;
157+ return null ;
158+ }
159+
142160function LoginAndOnboardingPageContent ( props : {
143161 redirectPath : string ;
144162 account : Account | undefined ;
0 commit comments