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

Firebase auth issue #8512

Closed
bunyaminmrcn opened this issue Sep 23, 2024 · 7 comments
Closed

Firebase auth issue #8512

bunyaminmrcn opened this issue Sep 23, 2024 · 7 comments

Comments

@bunyaminmrcn
Copy link

bunyaminmrcn commented Sep 23, 2024

Operating System

Windows 10, Apple Mac M2, Kali Linux, Arch Linux

Environment (if applicable)

Chrome 129, Firefox 130

Firebase SDK Version

10.13.2

Firebase SDK Product(s)

Auth, Firestore

Project Tooling

Next App with next-auth@beta with jwt strategy

Detailed Problem Description

I am signin with firebase using email and password. Then signin with next-auth@beta in next@14.2.13. It is produces in some browsers in the different Operating Systems. I run with firebase auth before send to request using

before

 firebaseAuth.setPersistence(auth.browserLocalPersistence)

inside then method

signInWithEmailAndPassword(firebaseAuth, email, password)

Steps and code to reproduce issue

in Arch linux - using Firefox 130 and Chrome 129 all works fine.
in Kali linux - using Firefox-esr and Chrome 129 - both of fails.
in Window 10 - using Firefox 130 and Chrome 129 - both of fails
in Apple M2 - using Chrome 129 works fine, using Firefox 130 fails.
Note: I am only loggedin with chrome with all os variants. But I dont think That reason occurs my plugins.
Sometimes( When browser very first starts works in firefox, then refresh it stops the working)

@bunyaminmrcn bunyaminmrcn added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Sep 23, 2024
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@bunyaminmrcn
Copy link
Author

Here is firestore rules of my write

rules_version = "2";

service cloud.firestore {
  match /databases/{database}/documents {
    // Allow only authenticated content owners access
    match /preferences/{userId}/{documents=**} {
      allow read, write: if request.auth != null && request.auth.uid == userId
    }
    match /users/{document} {
     allow read: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "Admin";
     allow write: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "SuperAdmin";
     allow list: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "Admin";
   }
    match /indexes/{document} {
       allow read: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "Admin";
    }

  }
}

@bunyaminmrcn bunyaminmrcn changed the title FirebaseError: Null value error. for 'list' @ L10, Null value error. for 'list' @ L12 Firebase auth issue Sep 23, 2024
@bunyaminmrcn
Copy link
Author

bunyaminmrcn commented Sep 23, 2024

Logged as an admin user. Here is the issue, the exact error is :

FirebaseError:  Null value error. for 'list' @ L10, Null value error. for 'list' @ L12

@bunyaminmrcn
Copy link
Author

bunyaminmrcn commented Sep 23, 2024

Passing request.auth != null to every did not a trick. Still not work in Window 10 completely and M2 firefox and Kali Linux. Just java versions is different. Works fine in Arch linux using JDK 17

@bunyaminmrcn
Copy link
Author

bunyaminmrcn commented Sep 23, 2024

I am up and running with Arch linux with openjdk-17.0.12 without any issue. Also tried microsoft build on windows 10 and apple mac(on firefox - chrome works) didn't work as well. Just enters initially then throws the errors both of on firefox and google-chrome. @microsoft @google

Also tried another microsoft builds (win10, kali linux, apple m2-(firefox)) of jdk 17.0.12 LTS didn't help

@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Sep 23, 2024
@bunyaminmrcn
Copy link
Author

I rebooted and removed to rules_version = "2"; from the head of firestore.rules file. It starts to work. But I do refresh a few times, throws again.

@bunyaminmrcn
Copy link
Author

bunyaminmrcn commented Sep 25, 2024

I changed my next-auth to stable version of 4. Issue still exists. But in production without using emulators everythings is fine.

@firebase firebase locked and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants