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

firebaseui doesn't work with sessionStorage when localStorage unavailable #1077

Open
skouny opened this issue Mar 18, 2024 · 2 comments
Open

Comments

@skouny
Copy link

skouny commented Mar 18, 2024

  • Operating System version: Android 14.0.0
  • Browser version: Android WebView 122.0
  • Firebase UI version: 6.1
  • Firebase SDK version: 10.8

When localStorage unavailable doesn't work with sessionStorage

setPersistence was set to browserSessionPersistence before FirebaseUI init

Screenshot_20240318_101319_WebPrintSDK

@jhuleatt
Copy link
Collaborator

Hi @skouny, this is interesting. FirebaseUI checks for both sessionStorage and localStorage:

storage.isAvailable = function() {
return new goog.storage.mechanism.HTML5LocalStorage().isAvailable() &&
new goog.storage.mechanism.HTML5SessionStorage().isAvailable();
};

However, it only seems to use sessionStorage and cookies, without any localStorage at all:

storage.Key = {
// Temporary storage.
PENDING_EMAIL_CREDENTIAL: {
name: 'pendingEmailCredential',
storage: storage.temporaryStorage_
},
REDIRECT_STATUS: {
name: 'redirectStatus',
storage: storage.temporaryStorage_
},
REDIRECT_URL: {
name: 'redirectUrl',
storage: storage.temporaryStorage_
},
// Cookie storage.
EMAIL_FOR_SIGN_IN: {
name: 'emailForSignIn',
storage: new goog.storage.Storage(
new firebaseui.auth.CookieMechanism(3600, '/'))
},
PENDING_ENCRYPTED_CREDENTIAL: {
name: 'pendingEncryptedCredential',
storage: new goog.storage.Storage(
new firebaseui.auth.CookieMechanism(3600, '/'))
}
};

Taking away the localStorage check seems like the right move to me. The codebase will need another look to confirm that localStorage really isn't used, though. I'll mark this as a bug.

@nkumawat34
Copy link

Can I work on this issue..

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

No branches or pull requests

3 participants