Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
packages/no-modal/src/connectors/wallet-connect-v2-connector/walletConnectV2Connector.ts
Show resolved
Hide resolved
packages/no-modal/src/connectors/base-evm-connector/baseEvmConnector.ts
Outdated
Show resolved
Hide resolved
packages/no-modal/src/connectors/wallet-connect-v2-connector/walletConnectV2Connector.ts
Outdated
Show resolved
Hide resolved
chaitanyapotti
left a comment
There was a problem hiding this comment.
i think we should use the AuthSessionManager to manage the session here and not write custom saving of tokens.
packages/no-modal/src/connectors/wallet-connect-v2-connector/walletConnectV2Connector.ts
Show resolved
Hide resolved
| */ | ||
| // TODO: rename this to match customauth, sfa | ||
| storageType?: "session" | "local" | "cookies"; | ||
| accessTokenProvider?: AccessTokenProvider; |
There was a problem hiding this comment.
i think we dont need to pass it here
| export type CONNECTOR_STATUS_TYPE = (typeof CONNECTOR_STATUS)[keyof typeof CONNECTOR_STATUS]; | ||
|
|
||
| export type IdentityTokenInfo = { idToken: string }; | ||
| export type IdentityTokenInfo = { idToken: string; accessToken?: string; refreshToken?: string }; |
| apiClientConfig: { baseURL: citadelServerUrl(this.coreOptions.authBuildEnv) }, | ||
| storage: this.coreOptions.storage, | ||
| cookieOptions: this.coreOptions.cookieOptions, | ||
| accessTokenProvider: this.coreOptions.accessTokenProvider, |
|
|
||
| const idToken = await this.authSessionManager.getIdToken(); | ||
| if (!idToken || checkIfTokenIsExpired(idToken)) { | ||
| return this.tryRefreshIdentityToken(); |
There was a problem hiding this comment.
idToken is never refreshed, it remains same for the entire session
|
|
||
| try { | ||
| const response = await this.authSessionManager.ensureRefresh(); | ||
| const refreshedIdToken = await this.authSessionManager.getIdToken(); |
There was a problem hiding this comment.
idtoken is never refreshed currently
packages/no-modal/src/noModal.ts
Outdated
| return this.state.idToken || null; | ||
| } | ||
|
|
||
| get accessToken(): string | null { |
| "@toruslabs/loglevel-sentry": "^9.0.0", | ||
| "@toruslabs/metadata-helpers": "^8.2.0", | ||
| "@toruslabs/secure-pub-sub": "4.3.0", | ||
| "@toruslabs/session-manager": "^5.6.0", |
There was a problem hiding this comment.
do we need this ? i think I exported everything from the auth package.
There was a problem hiding this comment.
@arch1995 we miss AuthSessionManager, do we will export from auth sdk?
| }); | ||
|
|
||
| const idToken = await verifySignedChallenge( | ||
| const tokens: SiwwTokens = await verifySignedChallenge({ |
There was a problem hiding this comment.
Hey, I saw this usage in multiple places (baseSolanaConnector, walletConnectV2Connector).
Would be nice if we could refactor this to shared func/method
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e46b571. Configure here.

Jira Link
Description
Fix
verifySignedChallengecall in the WalletConnect v2 connector to match the updatedVerifySignedChallengeParamsinterface from@toruslabs/base-controllers.The
baseEvmConnectorandbaseSolanaConnectorwere already updated butwalletConnectV2Connectorwas missed:deviceInfo: getDeviceInfo()parameter (required byVerifySignedChallengeParams)verifySignedChallengenow returnsSiwwTokens(withidToken,accessToken,refreshToken) instead of a plain stringIdentityTokenInfopattern, matching the other two connectorsHow has this been tested?
baseEvmConnector.tsandbaseSolanaConnector.tsScreenshots (if appropriate)
N/A
Types of changes
Checklist
Note
Medium Risk
Touches authentication/session persistence for external wallet connectors by introducing cached/refreshable token storage and changing the token API surface; regressions could break login/rehydration or token lifecycle across connectors. Dependency bumps (Torus controllers/Auth/MetaMask kit) also increase integration risk.
Overview
Adds a new auth token info flow that replaces
getIdentityToken/useIdentityTokenwithgetAuthTokenInfo/useAuthTokenInfoacross Modal + No-Modal SDKs and demo apps, standardizing on returning{ idToken, accessToken?, refreshToken? }.Implements external wallet session management in
@web3auth/no-modalby introducingAuthSessionManager-backed token caching/refresh + best-effort logout cleanup, wiring it through connector init/connection events (including WalletConnect v2) and persisting tokens in core state (supports SSR token fetch).Adds configurable token storage adapters (
storage/cookieOptions) and exposes a Vue demo setting to select token storage, while updating dependencies to newer@toruslabs/*/@web3auth/authversions and addingox.Reviewed by Cursor Bugbot for commit b232857. Bugbot is set up for automated code reviews on this repo. Configure here.