Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Does not redirect back to App #94

Closed
domwoe opened this issue Oct 23, 2018 · 3 comments
Closed

Does not redirect back to App #94

domwoe opened this issue Oct 23, 2018 · 3 comments

Comments

@domwoe
Copy link

domwoe commented Oct 23, 2018

I try to integrate Auth0 with my Ionic app and test it using iOS (simulator and device)

However, currently I'm hung up with the following situation:

Auth0 Hosted Login page is presented and I can enter my credentials. On clicking on the login button,
the spinner in the button appears and stays.

In the XCode console I can see the following
[APP IDENTIFIER]:https://[AUTH0 DOMAIN]/cordova/[APP IDENTIFIER]/callback?code=[CODE]&state=[STATE]

An in the Auth0 Dashboard I can see a successful login.

However nothing else happens...

I've included the following in the platform ready callback in my app.component.ts:
(window as any).handleOpenURL = (url: string) => {
console.log(url);
Auth0Cordova.onRedirectUri(url);
}

Any ideas how to debug?

@domwoe
Copy link
Author

domwoe commented Oct 23, 2018

Ok, I tried using the Ionic Deeplinks Plugin and can get the redirect URL.
I can call Auth0Cordova.onRedirectUri inside the deeplink callback but nothing happens.
The SafariViewController window gets not hidden and the authorize callback is never fired.

@domwoe
Copy link
Author

domwoe commented Oct 23, 2018

Eventually the issue was a race condition that could be solved by wrapping the
Auth0Cordova.onRedirectUri(url) call inside a setTimeout

@luisrudge
Copy link
Contributor

Thanks for sharing the solution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants