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

Error on sign in with google #58

Open
rahulkumarsingh73690 opened this issue Dec 14, 2020 · 14 comments
Open

Error on sign in with google #58

rahulkumarsingh73690 opened this issue Dec 14, 2020 · 14 comments
Labels
bug Something isn't working

Comments

@rahulkumarsingh73690
Copy link

Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.96. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Dec 14, 2020
@samuelgozi
Copy link
Owner

Sorry for the late response.
Can you share some code?

@vamsi-manyam
Copy link

Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.

Hey! Were you able to find the solution for this?

@samuelgozi
Copy link
Owner

samuelgozi commented Jan 10, 2021 via email

@vamsi-manyam
Copy link

Hi, due to lack of free time I didn’t get a deep look into this issue. If you guys can attach the coda that causes the error it will help me. בתאריך יום א׳, 10 בינו׳ 2021 ב-13:37 מאת vamsi-manyam < [email protected]>:

Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared. Hey! Were you able to find the solution for this? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#58 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADS4MPFB5TKQPRAHNJSJ4DSZGGQDANCNFSM4U2IOENQ .

Okay ill explain the scenario..I actually implemented the firebase google signing which was working perfectly in both the web and mobile browser. But the issue arises when i share my website link to someone in Instagram/Facebook. My friend clicks the URL it opens in the inbuilt browser of Instagram and in this in-app browser the google signing is not working..it throws an error which i have attached below.

I have also attached the code for google signin!!
Thanks in advance
WhatsApp Image 2021-01-10 at 10 58 09 `AM

googleSignIn = (event) => {

var app = this.props.firebase.firebaseApp();
var auth = this.props.firebase.firebaseAuth()
console.log("google", app)
var provider = new app.auth.GoogleAuthProvider()
// provider.addScope('https://www.googleapis.com/auth/contacts.readonly');
provider.addScope('https://www.googleapis.com/auth/userinfo.email')
auth.signInWithPopup(provider).then((result) => {
  var token = result.credential.accessToken;
  var user = result.user;

  this.props.firebase.user(user.uid).on('value',snapshot=>{
    let myuser = snapshot.val();
    console.log("signedddinn",myuser)

    if(myuser){
      //user already created..this is just login
      this.props.history.push("/");
    }
    else{
      //user is not existing..so create a user in our db
      this.props.firebase
            .user(user.uid)
            .set({
              username : user.displayName,
              email : user.email,
              photoUrl : user.photoURL
              
            }).then((u)=>{
              // console.log("pushing success",u)
            }).catch((error)=>{
              console.log("pushing error",error)
            })

      this.props.history.push("/");
    } 
  })
}).catch(function (error) {
  console.log("error in google", error)
});

}

onChange = event => {
this.setState({ [event.target.name]: event.target.value });
};

@samuelgozi
Copy link
Owner

@vamsi-manyam Thank you very much for the detailed example.
I know its been a while since this issue was opened, and I'm sorry for that.
I will try to solve this this week but I can't anything yet.

@clarkdong
Copy link

@samuelgozi @vamsi-manyam I'm not sure if this is an issue with the lib, I suspect it might be an issue with the setting of the client device, like local storage config. My users are seeing the problem intermittently but I can't figure out the pattern yet because not enough data.

@sesam
Copy link

sesam commented May 6, 2021

localStorage is unsupported/buggy in various situations in Firefox and Safari. We're having trouble with iPad and Firefox users getting into trouble, and one version of Chrome - typically it's the Anonymous/Incognito mode that has limitations, but also Corporate/Phones with some added restrictions and here it looks like also sometimes in web views from other applications.
It might be that to get around this localStorage isn't usable. Maybe worth trying to fall back to sessionStorage, as persistence in Incognito / other apps's web views is anyway pointless.

@ManojKumarForcebolt
Copy link

Have anyone find the solution to this issue because I am facing the same issue while I am doing Google integration in Electron JS App

@samuelgozi
Copy link
Owner

Sorry for being late into the conversation.
New changes in firefox, safari and also chrome (not sure about the version) block any form of persistent local storage when in incognito. This is is done to block tracking and fingerprinting. I don't think that its the same issue experienced by the issue on top.

As suggested I think that we need to look for a fallback that is not blocked. Im not sure about sessionStorage, I might need to try it.

On a different note. I just wanted to say that Im sorry for not fixing this yet. In the last about 6~ months I didn't have much spare time, and every time I did have it was then filled by other stuff that I had to do. So that's why this project (and any other project on my GitHub account) has been dead.

I can't promise timelines, but I do intend on finding a way to still maintain and update this library. Once I start working again on personal projects this one (all of the "lite" firebase libraries) will be the first to receive my attention.

@andesappal
Copy link

@strom2357 I have the same error but for phone sign-in with firebase_auth: ^0.20.1

@annaharri89
Copy link

I'm getting this for the firebase auth sdk as well

@masaki-takano
Copy link

Check https://support.apple.com/en-gb/guide/safari/sfri40732/mac

In the Safari app on your Mac, choose Safari > Preferences, then click Privacy.

Select “Prevent cross-site tracking”. --> TURN OFF

@LaraCesio
Copy link

I'm facing the same message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants