diff --git a/README.md b/README.md index a87f0aef..bc56e606 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,7 @@ function App() { waasConfigKey: '', googleClientId, appleClientId, - appleRedirectUrl, - emailAuthVersion // (default 2), 1 for legacy + appleRedirectUrl }) */ diff --git a/examples/react/src/config.ts b/examples/react/src/config.ts index 755ef520..8ed16729 100644 --- a/examples/react/src/config.ts +++ b/examples/react/src/config.ts @@ -47,7 +47,7 @@ const getWaasConnectors = () => { appleRedirectURI, appName: 'Kit Demo', projectAccessKey, - // emailAuthVersion: 1, + // legacyEmailAuth: true, enableConfirmationModal: localStorage.getItem('confirmationEnabled') === 'true', isDev: isDebugMode }) diff --git a/packages/kit/src/config/defaultConnectors.ts b/packages/kit/src/config/defaultConnectors.ts index f35ccab1..4a9a2b2f 100644 --- a/packages/kit/src/config/defaultConnectors.ts +++ b/packages/kit/src/config/defaultConnectors.ts @@ -83,7 +83,7 @@ interface GetDefaultWaasConnectors { appName: string defaultChainId?: number - emailAuthVersion?: 1 | 2 + legacyEmailAuth?: boolean enableConfirmationModal?: boolean @@ -100,16 +100,16 @@ export const getDefaultWaasConnectors = ({ appName, defaultChainId, enableConfirmationModal, - emailAuthVersion, + legacyEmailAuth = false, isDev = false }: GetDefaultWaasConnectors): CreateConnectorFn[] => { const wallets: any[] = [ emailWaas({ - emailAuthVersion, projectAccessKey, waasConfigKey, enableConfirmationModal, network: defaultChainId, + legacyEmailAuth, isDev }), coinbaseWallet({ diff --git a/packages/kit/src/connectors/email/emailWaas.ts b/packages/kit/src/connectors/email/emailWaas.ts index 4fce5d4c..ca03b46b 100644 --- a/packages/kit/src/connectors/email/emailWaas.ts +++ b/packages/kit/src/connectors/email/emailWaas.ts @@ -3,16 +3,16 @@ import { sequenceWaasWallet, BaseSequenceWaasConnectorOptions } from '../wagmiCo import { getEmailLogo } from './EmailLogo' -export type EmailWaasOptions = { emailAuthVersion?: 1 | 2 } & Omit +export type EmailWaasOptions = { legacyEmailAuth?: boolean } & Omit -export const emailWaas = ({ emailAuthVersion = 2, ...rest }: EmailWaasOptions): Wallet => ({ +export const emailWaas = ({ legacyEmailAuth = false, ...rest }: EmailWaasOptions): Wallet => ({ id: 'email-waas', logoDark: getEmailLogo({ isDarkMode: true }), logoLight: getEmailLogo({ isDarkMode: false }), name: 'Email', type: 'social', createConnector: () => { - const options = { emailAuthVersion, ...rest } + const options = { legacyEmailAuth, ...rest } const connector = sequenceWaasWallet({ ...options, loginType: 'email' diff --git a/packages/kit/src/hooks/useWaasEmailAuth.ts b/packages/kit/src/hooks/useWaasEmailAuth.ts index 4bced5f7..147f9cdd 100644 --- a/packages/kit/src/hooks/useWaasEmailAuth.ts +++ b/packages/kit/src/hooks/useWaasEmailAuth.ts @@ -59,7 +59,7 @@ export function useEmailAuth({ setLoading(true) setError(undefined) - if (params.emailAuthVersion === 1) { + if (params.legacyEmailAuth) { try { const { instance } = await waas.email.initiateAuth({ email }) setInstance(instance) @@ -98,7 +98,7 @@ export function useEmailAuth({ setLoading(true) setError(undefined) - if (params.emailAuthVersion === 1) { + if (params.legacyEmailAuth) { // version 1 try { const sessionHash = await waas.getSessionHash()