firebase auth not work with PWA installed on Android desktop

后端 未结 1 1074
囚心锁ツ
囚心锁ツ 2021-01-13 17:54

I have built a SPA that works in the browser in that on load it provides an auth option, I click google signin and the firebase auth flow continues until I have an auth toke

1条回答
  •  借酒劲吻你
    2021-01-13 18:20

    Per @jasan 's request, I did find a solution based on @bojeil 's comment

    function signinGoogle(cb) {
        var provider = new firebase.auth.GoogleAuthProvider();
        // firebase.auth().signInWithPopup(provider).then(function(result) {
        firebase.auth().signInWithRedirect(provider).then(function(result) {
            console.log("Google signin successful")
            // This gives you a Google Access Token. You can use it to access the Google API.
            // var token = result.credential.accessToken;
    
            // Send user  to rest of program
            cb(token)
        })
        .catch(function(error) {
            logger(error);
        });
    }
    

    0 讨论(0)
提交回复
热议问题