Improve local storage session keys for development#42
Improve local storage session keys for development#42jarrodwatts merged 3 commits intoAbstract-Foundation:mainfrom Morgosh:main
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@Morgosh is attempting to deploy a commit to the Abstract Foundation Team on Vercel. A member of the Team first needs to authorize it. |
| */ | ||
| export default function Home() { | ||
| const { address, isConnected } = useAccount(); | ||
| const { disconnect } = useDisconnect(); |
There was a problem hiding this comment.
I think this should use the logout function from the AGW hook useLoginWithAbstract
|
Thanks for this @Morgosh! I like these improvements - one small feedback is I think the logout function needs to be called to properly handle the privy logout side of the wallet disconnect |
Thanks for the feedback! Updated |
|
Thanks for this! Looks good to me |
Added option to logout
Session should load on refresh (wait for client)
Based on the network, the session keys should be recreated
Based on connected user, the session keys should be recreated
If policies change, then the session should be recreated
Makes development easier
PR-Codex overview
This PR focuses on enhancing session management and environment-specific configurations in the application. It introduces default call policies, modifies storage key prefixes based on the environment, and updates session handling in the
Homecomponent.Detailed summary
chainassignment inchain.tsfor production environment.DEFAULT_CALL_POLICIESingetStoredSession.ts.LOCAL_STORAGE_KEY_PREFIXandENCRYPTION_KEY_PREFIXinconstants.tsto includeNODE_ENV.DEFAULT_CALL_POLICIESincreateAndStoreSession.ts.callPolicieswithDEFAULT_CALL_POLICIESincreateAndStoreSession.useLoginWithAbstractandhandleLogoutinpage.tsx.useEffectdependency to includeclient?.account?.address.