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 permission denied: authError with useSelector #27

Open
wooogler opened this issue Dec 12, 2019 · 0 comments
Open

Firebase permission denied: authError with useSelector #27

wooogler opened this issue Dec 12, 2019 · 0 comments

Comments

@wooogler
Copy link

Hi, I'm Sangwook.
I'm studying to develop the react app with firebase.
Your Tutorial is SO COOL!!! Those are the best lectures!
I prefer to the latest version, so I create marioplan with react hooks and latest firebase library.

But, I have a trouble in Tutorial #32-Firestore Sercurity Rules.

I use "useSelector" for using authError in SignIn.js like this
const authError = useSelector(state => state.auth.authError);

After I signed in the app, when I log out,
there is a firebase error "Unhandled Rejection (FirebaseError): Missing or insufficient permissions."

I think it is because the app try to read the database for authError even user is not signed in.
So, I try to move the hooks into handleSubmit, but it is not allowed by hooks rule.

How can I solve this problem?
Thank you.

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