Expectation:
- A user signs in through SIWE flow ⇒ an application knows the person's address
- A user reloads a page through Command+R ⇒ the application continues the session
Reality:
- A user signs in through SIWE flow ⇒ the application knows the person's address
- A user reloads a page through Command+R ⇒ the application asks for a SIWE signature again
It looks like Web3Modal SIWE flow forgets about a SIWE session. The root cause is that
Web3Modal gets caipAddress
property
initialized from AccountController.state.address
which is not a CAIP address.
See how fix
branch here applies a patch to initialize caipAddress
from AccountController.state.caipAddress
.
After you sign in and refresh a page, a user still is considered signed in, which is an expected behaviour.
pnpm install
pnpm run dev
- Open http://localhost:5173, click "Connect" button and go through SIWE flow.
- Refresh the page. On
main
branch you'd see a SIWE signature prompt, onfix
branch you are still considered signed in.