-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: siwx cloud auth config flag #3424
Closed
Closed
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
4559f59
refactor: add params in getNonce function
zoruka 4938fdb
feat: add map to siwx function
zoruka 2ce57a2
refactor: apply siwx over siwe
zoruka 07a6605
Merge branch 'main' of github.com:WalletConnect/web3modal into chore/…
zoruka 63c34ef
Merge branch 'main' of github.com:WalletConnect/web3modal into chore/…
zoruka 6e4cbed
fix: issues after rebase
zoruka 2e01a07
chore: revert ts issue changes on solana adapter
zoruka 04a1c90
fix: formating issue
zoruka 3190dcf
Merge branch 'main' of github.com:WalletConnect/web3modal into chore/…
zoruka 36598e9
fix: missing siwx initialization
zoruka edb0fe5
refactor: move validation to LocalStorage to keep independent from si…
zoruka b72b68d
fix: fix LocalStorage validation
zoruka fc061f2
Merge branch 'main' of github.com:WalletConnect/web3modal into chore/…
zoruka 7bec91c
fix: missing setClientId
zoruka c30c03a
feat: add siwx cloud auth storage
zoruka 2b511f7
Merge branch 'chore/siwe-to-siwx-migration' of github.com:WalletConne…
zoruka bd8aab5
chore: update branch and adde clientId in the request
zoruka bbb3561
fix: formating issue
zoruka 18760c2
Merge branch 'main' of github.com:WalletConnect/web3modal into feat/s…
zoruka 4c5806e
wip: get correct nonce and set token
zoruka ed1f6d9
fix(siwx-msg): chain ID should be after version
Cali93 3a4f132
refactor: create CloudAuthSIWX config instead of extending DefaultSIWX
zoruka 260d1da
fix(auth): fix auth flow to set token
Cali93 6fc6e42
fix: informal message clear chain id namespace
zoruka 3113939
fix: setSessions logic to clear session and get correct session from …
zoruka ebc7a1d
fix: universalProviderAuthenticate to only accept eip155 and show aut…
zoruka 4f78505
feat: add autoClose flag for snackbar
zoruka 975ff8b
Merge branch 'main' of github.com:WalletConnect/web3modal into feat/s…
zoruka e318f4d
test: add tests for CloudAuthSIWX
zoruka b752093
fix: dependecy static version and formatting
zoruka 75e3934
Merge branch 'main' of github.com:WalletConnect/web3modal into feat/s…
zoruka 7fa8841
chore: add page for siwx cloud auth
zoruka aea0bdf
test: fix SnackController tests and add test for autoClose
zoruka f6d5742
test: fix SnackController tests and add test for autoClose
zoruka 8670737
test: mock host and href
zoruka 22dd48d
Merge branch 'main' of github.com:WalletConnect/web3modal into feat/s…
zoruka 3dae36b
Merge branch 'main' into feat/siwx-cloud-auth
zoruka 0c0e557
Merge branch 'main' into feat/siwx-cloud-auth
zoruka 4e2b45a
feat: add setup for auth flag and siwx usage
zoruka bd70839
Merge branch 'main' of github.com:WalletConnect/web3modal into feat/s…
zoruka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -680,7 +680,6 @@ export class AppKit { | |||||
OptionsController.setTermsConditionsUrl(options.termsConditionsUrl) | ||||||
OptionsController.setPrivacyPolicyUrl(options.privacyPolicyUrl) | ||||||
OptionsController.setCustomWallets(options.customWallets) | ||||||
OptionsController.setFeatures(options.features) | ||||||
OptionsController.setEnableWalletConnect(options.enableWalletConnect !== false) | ||||||
OptionsController.setEnableWallets(options.enableWallets !== false) | ||||||
OptionsController.setEIP6963Enabled(options.enableEIP6963 !== false) | ||||||
|
@@ -724,6 +723,20 @@ export class AppKit { | |||||
OptionsController.setSIWX(siwe.mapToSIWX(options.siweConfig)) | ||||||
} | ||||||
} | ||||||
|
||||||
OptionsController.subscribeKey('features', async features => { | ||||||
if (features?.auth) { | ||||||
if (OptionsController.state.siwx) { | ||||||
console.warn("SIWX config already enabled, 'auth' feature will not be enabled") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
return | ||||||
} | ||||||
|
||||||
const siwx = await import('@reown/appkit-siwx') | ||||||
OptionsController.setSIWX(new siwx.CloudAuthSIWX()) | ||||||
} | ||||||
}) | ||||||
OptionsController.setFeatures(options.features) | ||||||
} | ||||||
|
||||||
private getDefaultMetaData() { | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import { FetchUtil } from '../utils/FetchUtil.js' | |
import { StorageUtil } from '../utils/StorageUtil.js' | ||
import type { | ||
ApiGetAnalyticsConfigResponse, | ||
ApiGetProjectConfigResponse, | ||
ApiGetWalletsRequest, | ||
ApiGetWalletsResponse, | ||
WcWallet | ||
|
@@ -276,7 +277,8 @@ export const ApiController = { | |
ApiController.fetchFeaturedWallets(), | ||
ApiController.fetchRecommendedWallets(), | ||
ApiController.fetchNetworkImages(), | ||
ApiController.fetchConnectorImages() | ||
ApiController.fetchConnectorImages(), | ||
ApiController.fetchProjectConfig() | ||
] | ||
if (OptionsController.state.features?.analytics) { | ||
promises.push(ApiController.fetchAnalyticsConfig()) | ||
|
@@ -290,5 +292,14 @@ export const ApiController = { | |
params: ApiController._getSdkProperties() | ||
}) | ||
OptionsController.setFeatures({ analytics: isAnalyticsEnabled }) | ||
}, | ||
|
||
async fetchProjectConfig() { | ||
const { isAnalyticsEnabled, isAppKitAuthEnabled } = await api.get<ApiGetProjectConfigResponse>({ | ||
path: '/getProjectConfig', | ||
params: ApiController._getSdkProperties() | ||
}) | ||
console.log({ isAnalyticsEnabled, isAppKitAuthEnabled }) | ||
OptionsController.setFeatures({ analytics: isAnalyticsEnabled, auth: isAppKitAuthEnabled }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we set siwx's value to the CloudAuthSIWX instance if it's enabled ? |
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this flag here if we already have the siwx param?