简体   繁体   中英

Failure setting window.location in PWA on iOS 15+ for authentication experience

I'm currently building a website that offers login with Facebook as a method to get users authenticated into my own Identity system, and it works well in normal browsers on all platforms. But when I install it as PWA on iOS 15+, the Facebook login is not functioning as expected as the webView is not honoring the window.location=<MY OWN CALLBACK URL TO MY SERVER> . Below are the scripts from my server that's handling the callback from Facebook, seems both window.opener.location and window.location setting failed because the popup window was closed but nothing happened in the opener.

<script type="text/javascript">
    var redirectUri = '${myApp() + "/login?"}';
    redirectUri = redirectUri + "access_token=" + "${access_token?no_esc}" + "&token_type=fb";
    redirectUri = redirectUri + "&_eventId=loginFromFacebook";
    

    if ( window.opener ) {
        window.opener.location = redirectUri;
        self.close();
    }

    window.location = redirectUri;

</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM