question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auth not populated on 2nd authorize

See original GitHub issue

When I authorise user that has already been logged into the database, like so:

this.props.firebase.login({
  email: existing_user@gmail.com',
  password: 'trees'
})

…the first time it happens, this.props.auth is populated with the user info, and the rest of the props (e.g. todos) are received from firebase as I would hope and subsequently render to the page.

Then, when I call firebase.logOut(), this.props.auth returns null again, and the rest of the props disappear. Again, this is the desired result.

It’s when I call login() a second time that the problem occurs. The auth object is populated again like last time, but the rest of the props such as todo are not received. I tried setting the “rules” object in the console to the ‘PUBLIC’ setting to rule out any permissions restrictions being part of the problem but I got the same response.

The only difference in how redux receives the state from firebase between auth and todos is auth uses pathToJS, and todos uses dataToJS - could this be part of the problem?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jarbotcommented, Mar 24, 2017

@prescottprue thank you for your help. I tried different variations of ‘/todos’ and ‘todos’ and it didn’t resolve my issue. After more testing todos do not populate until user is authorized and I refresh the page. This probably something I’ve done to mess it up. I have not implemented componentShouldUpdate anywhere. I will open a new issue if this isn’t some dumb mistake I’ve made. Thanks again.

0reactions
prescottpruecommented, Mar 24, 2017

@jarbot No you don’t have to manually call dataToJS. Your syntax should work.

Try using /todos in your dataToJS call to match what you pass to firebaseConnect, or change what you pass to firebaseConnect to todos (no slash).

This issue ended up being due to usage of componentShouldUpdate before, so you might be seeing something different.

Please open a new issue that has what version number you are using, and an example to reproduce the error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 11: A duplicate transaction has been submitted.
The error indicates that a transaction request was submitted within a few minutes of a previous attempt with the same information. Authorize.Net ...
Read more >
Angular 2 Basic Authentication not working - Stack Overflow
I'm trying to connect/ do a POST request to an API with Angular2, It's a very simple API with a Basic Authentication password....
Read more >
Authentication Filters in ASP.NET Web API 2 - Microsoft Learn
Authorization determines whether the client can access a particular resource. In Web API, authentication filters handle authentication, but not ...
Read more >
Authorization and authentication - AWS AppSync
There are five ways you can authorize applications to interact with your AWS AppSync GraphQL API. You specify which authorization type you use...
Read more >
API (GraphQL) - Setup authorization rules - AWS Amplify Docs
If a mutation does not include `owner` field in the selection set of a owner based auth, Subscription message won't be fired for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found