Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sync openUrl #1087

Merged
merged 1 commit into from Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 22 additions & 4 deletions src/global.ts
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