auth0-samples / auth0-ionic4-samples

Auth0 Integration Samples for Ionic 4
https://auth0.com/docs/quickstart/native/ionic4/01-login
MIT License
2 stars 14 forks source link

Logout doesn't close WebView on ios #5

Closed nharrer closed 4 years ago

nharrer commented 4 years ago

I ran this example on ios without modifications after downloading it from my project's quickstart section (auth.config.ts was already created correctly by quickstart).

I have following global npm packages installed:

npm ls -g --depth=0 ├── @angular/cli@7.3.3 ├── cordova@9.0.0 ├── cordova-check-plugins@4.0.5 ├── cordova-res@0.6.0 ├── ionic@5.2.7 ├── ios-deploy@1.9.4 ├── native-run@0.2.9 ├── npm@6.13.4 ├── remotedebug-ios-webkit-adapter@0.3.2 └── rimraf@3.0.0

The device is ios 13.3. Xcode Version 11.3

The whole example runs flawlessly. Only when doing a logout the WebView stays open:

webview-not-closing

The exact same example logs out ok on android. So I think I have the callback urls etc. configured correctly.

I have connected safari in debug mode. I see the "Opened" and "Loaded" message from the safariViewController callbacks in the console. But not the "Closed". No other errors or warnings either. When I check the user's history on auth0's manage page, I can see that the logout was performed. Only the WebView didn't close.

cocojoe commented 4 years ago

@davidpatrick can you pair with @Widcket on this. Should give enough perspective on both sides. Thanks

davidpatrick commented 4 years ago

https://github.com/auth0-samples/auth0-ionic4-samples/pull/6

alexfin90 commented 4 years ago

I have similar problem but in on the log in. Only on iOS after some days of use the auth0 login page not load and only the white page is showed. If i delete and re-install the app work.

patkremer commented 4 years ago

I have a similar problem. Login works, logout doesn't work for android or ios for me. I was able to get android to work by doing something like this


            if (result.event === 'loaded') {
                console.log('loaded');

                this.zone.run(() => {
                  this.safariViewController.hide();
                });
              }

              if (result.event === 'closed') {
                console.log('Closed');
                this.zone.run(() => {
                  this.router.navigateByUrl('/auth/login');
                });
              }
`