From 5c373f0e05b5a7b16e320c4ddefa6d505fc69b55 Mon Sep 17 00:00:00 2001 From: Poovamraj T T Date: Tue, 28 Nov 2023 14:35:36 +0100 Subject: [PATCH] Update documentation --- FAQ.md | 2 +- src/types.ts | 14 ++++++++++++++ src/webauth/index.ts | 2 -- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/FAQ.md b/FAQ.md index d250bb54..5987c814 100644 --- a/FAQ.md +++ b/FAQ.md @@ -88,7 +88,7 @@ An alternative is to use `SFSafariViewController` instead of `ASWebAuthenticatio auth0.webAuth .authorize( { scope: 'openid profile email' }, - { useSFSafariViewController: {} } // Use SFSafariViewController + { useSFSafariViewController: true } // Use SFSafariViewController ) .then((credentials) => console.log(credentials)) .catch((error) => console.log(error)); diff --git a/src/types.ts b/src/types.ts index f2c73775..368ab2a9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -116,6 +116,20 @@ export interface WebAuthorizeOptions { useLegacyCallbackUrl?: boolean; /** * **iOS only:** Uses `SFSafariViewController` instead of `ASWebAuthenticationSession`. If empty object is set, the presentationStyle defaults to {@link SafariViewControllerPresentationStyle.fullScreen} + * + * This can be used as a boolean value like + * + * @example + * ```typescript + * await authorize({}, {useSFSafariViewController: true}); + * ``` + * + * or + * + * @example + * ```typescript + * await authorize({}, {useSFSafariViewController: {presentationStyle: SafariViewControllerPresentationStyle.fullScreen}}); + * ``` */ useSFSafariViewController?: | { diff --git a/src/webauth/index.ts b/src/webauth/index.ts index 62fcbfc7..c4b22030 100644 --- a/src/webauth/index.ts +++ b/src/webauth/index.ts @@ -49,8 +49,6 @@ class WebAuth { options: WebAuthorizeOptions = {} ): Promise { const { clientId, domain, agent } = this; - console.log(options); - console.log(options.useSFSafariViewController); let presentationStyle = options.useSFSafariViewController ? (options.useSFSafariViewController as { presentationStyle: number }) ?.presentationStyle ??