Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
poovamraj committed Nov 28, 2023
1 parent 2a85c9f commit 5c373f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
14 changes: 14 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?:
| {
Expand Down
2 changes: 0 additions & 2 deletions src/webauth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class WebAuth {
options: WebAuthorizeOptions = {}
): Promise<Credentials> {
const { clientId, domain, agent } = this;
console.log(options);
console.log(options.useSFSafariViewController);
let presentationStyle = options.useSFSafariViewController
? (options.useSFSafariViewController as { presentationStyle: number })
?.presentationStyle ??
Expand Down

0 comments on commit 5c373f0

Please sign in to comment.