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.

Mutation is not called when logout

See original GitHub issue
auth: {
  initialize: {
    onSuccessMutation: 'ON_SUCCESS_MUTATION',
    onSuccessAction: null,
    onErrorMutation: null,
    onErrorAction: 'onErrorAction',
    ssr: false // default
  }
}

ON_SUCCESS_MUTATION is called only when the user log in. Do should be called when log out?

firebase.auth().onAuthStateChanged(function(user) {
  if (user) {
    // User is signed in.
    var displayName = user.displayName;
    var email = user.email;
    var emailVerified = user.emailVerified;
    var photoURL = user.photoURL;
    var isAnonymous = user.isAnonymous;
    var uid = user.uid;
    var providerData = user.providerData;
    // ...
  } else {
    // User is signed out.
    // ...
  }
});

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lupascommented, Mar 13, 2020

reset the store

It’s will not help if the logout is initialized by the google server.

I agree. Will be implemented in next major release, probably in the next few days 😃

0reactions
b01110011commented, Mar 16, 2020

@lupas I tested onAuthStateChanged and ssr auth. It’s work great. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

React query useMutation error: onLogout is not a function
I'm implementing React Query's useMutation for a simple api call (a user logout). I've written a code that seems correct, ...
Read more >
GraphQL Mutation vs Query – When to use a GraphQL Mutation
If queries are the GraphQL equivalent to GET calls in REST, then mutations represent the state-changing methods in REST (like DELETE , PUT...
Read more >
Logout in React with GraphQL - Part 47 - YouTube
Learn how to logout users in React with GraphQL.Code: https://github.com/benawad/fullstack-graphql-airbnb-clone/tree/47_logoutPlaylist: ...
Read more >
Authorization and the logOut Resolver - Building Full Stack ...
We will also see how we can implement the logOut mutation. ... for signing and verification, but this is not always the case...
Read more >
Mutations - Ariadne GraphQL
logout that takes no arguments and just returns status. Writing resolvers. Mutation resolvers are no different than resolvers used by other types. They...
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