diff --git a/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx b/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx index 415d510e..e21604f9 100644 --- a/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx +++ b/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx @@ -266,7 +266,7 @@ export const ConnectWalletContent = (props: ConnectWalletContentProps) => { { if (credentialResponse.credential) { storage?.setItem(LocalStorageKey.WaasGoogleIdToken, credentialResponse.credential) @@ -284,16 +284,16 @@ export const ConnectWalletContent = (props: ConnectWalletContentProps) => { { - const appleClientId = (storage?.getItem(LocalStorageKey.WaasAppleClientID) as string) || '' - const appleRedirectUri = (storage?.getItem(LocalStorageKey.WaasAppleRedirectURI) as string) || '' - const sessionHash = (storage?.getItem(LocalStorageKey.WaasSessionHash) as string) || '' + const appleClientId = localStorage.getItem('wagmi.' + LocalStorageKey.WaasAppleClientID) || '' + const appleRedirectUri = localStorage.getItem('wagmi.' + LocalStorageKey.WaasAppleRedirectURI) || '' + const sessionHash = localStorage.getItem('wagmi.' + LocalStorageKey.WaasSessionHash) || '' appleAuthHelpers.signIn({ authOptions: { - clientId: appleClientId, + clientId: JSON.parse(appleClientId), scope: 'openid email', - redirectURI: appleRedirectUri, + redirectURI: JSON.parse(appleRedirectUri), usePopup: true, - nonce: sessionHash + nonce: JSON.parse(sessionHash) }, onSuccess: (response: any) => { if (response.authorization?.id_token) { diff --git a/packages/kit/src/utils/ethAuth.ts b/packages/kit/src/utils/ethAuth.ts index 25cdba16..29de2a52 100644 --- a/packages/kit/src/utils/ethAuth.ts +++ b/packages/kit/src/utils/ethAuth.ts @@ -12,7 +12,7 @@ import { EthAuthSettings } from '../components/KitProvider' export const signEthAuthProof = async (walletClient: GetWalletClientData): Promise => { const wagmiConfig = useConfig() const storage = wagmiConfig.storage as Storage<{ [key: string]: string }> - const proofInformation = storage?.getItem(LocalStorageKey.EthAuthProof) as string | undefined + const proofInformation = localStorage.getItem('wagmi.' + LocalStorageKey.EthAuthProof) // if proof information was generated and saved upon wallet connection, use that if (proofInformation) { const proof = JSON.parse(proofInformation) as ETHAuthProof @@ -20,7 +20,7 @@ export const signEthAuthProof = async (walletClient: GetWalletClientData