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

IOS EasyAuth.signOut() does not sign out. #21

Open
dankelley2 opened this issue Mar 6, 2023 · 1 comment
Open

IOS EasyAuth.signOut() does not sign out. #21

dankelley2 opened this issue Mar 6, 2023 · 1 comment

Comments

@dankelley2
Copy link

dankelley2 commented Mar 6, 2023

Love the design of your library, though I'm having a few issues with EasyAuth.

I've been attempting to use easy-firebase for a basic email authentication IOS app, and it seems there there are some issues in the IOS example that are also happening when I implement the library with the base instructions provided.

Reproducible by compiling the latest IOS example, signing in with email, and attempting to sign out.

IOS 16.2
Iphone 14 Pro
easy-firebase 1.4.3

Firestore rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null;
    }
  }
}

After setting the state of my app to "signed out", which brings my app back to it's original Sign In form, and running "EasyAuth.signOut()", I receive the following logged errors:

Screenshot 2023-03-06 at 12 33 32 PM

This is not a problem if I change my firestore rules to just "allow read, write;" (which is certainly not a solution). Is there a listener that could still be attached when the sign out function succeeds and my auth header is no longer valid?

@dankelley2
Copy link
Author

dankelley2 commented Mar 6, 2023

It looks like stopping the listener before the guard check at onUserUpdate is fixing this issue in my case (swapping lines) 144 / 145:

Screenshot 2023-03-06 at 1 54 43 PM

Is there any reason why you want to keep the listener running if Auth._currentuser becomes nil?

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

No branches or pull requests

1 participant