Skip to content

Commit

Permalink
Allow sync openUrl (#1087)
Browse files Browse the repository at this point in the history
Co-authored-by: adamjmcgrath <[email protected]>
  • Loading branch information
adamjmcgrath and adamjmcgrath committed Mar 14, 2023
1 parent 827bc82 commit dc36d33
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,21 @@ export interface RedirectLoginOptions<TAppState = any>
*
* @example
* const client = new Auth0Client({
* async openUrl(url) {
* openUrl(url) {
* window.location.replace(url);
* }
* });
*
* @example
* import { Browser } from '@capacitor/browser';
*
* const client = new Auth0Client({
* async openUrl(url) {
* await Browser.open({ url });
* }
* });
*/
openUrl?: (url: string) => Promise<void>;
openUrl?: (url: string) => Promise<void> | void;
}

export interface RedirectLoginResult<TAppState = any> {
Expand Down Expand Up @@ -466,12 +475,21 @@ export interface LogoutOptions extends LogoutUrlOptions {
*
* @example
* await auth0.logout({
* async openUrl(url) {
* openUrl(url) {
* window.location.replace(url);
* }
* });
*
* @example
* import { Browser } from '@capacitor/browser';
*
* await auth0.logout({
* async openUrl(url) {
* await Browser.open({ url });
* }
* });
*/
openUrl?: false | ((url: string) => Promise<void>);
openUrl?: false | ((url: string) => Promise<void> | void);
}

/**
Expand Down

0 comments on commit dc36d33

Please sign in to comment.