Coder Social home page Coder Social logo

Comments (6)

louisnt-prod avatar louisnt-prod commented on May 18, 2024

FYI, I downgraded to 0.12.2, no issue with this version in case someone is facing the same issue.

from next-firebase-auth.

Twister42 avatar Twister42 commented on May 18, 2024

Same problem here, works with alpha.0

from next-firebase-auth.

aprendendofelipe avatar aprendendofelipe commented on May 18, 2024

This problem starts in 0.13.0-alpha.2

from next-firebase-auth.

kmjennison avatar kmjennison commented on May 18, 2024

Thanks for the report. I'm able to reproduce and am working on a fix. It looks like the problem is that we used the spread operator to modify the JS SDK Firebase user (in useFirebaseUser.js), but doing that drops its methods.

from next-firebase-auth.

litewarp avatar litewarp commented on May 18, 2024

@kmjennison Just about to say that!

The easiest fix is to change the function in createAuthUser to

getIdToken: async () => firebase.auth.currentUser.getIdToken()

But that blows up the test coverage, but it feels like you're better at that, so hopefully it won't take too long. The other option is to pass the user and the claims separately to the setAuthCookie function.

Also another workaround atm is to use the customTokenHandler and call firebase.auth.currentUser.getIdToken() in that function.

Edit: It looks like you can just clone the firebaseUser object and mutate the clone directly, e.g., firebaseUserWithClaims.claims = idTokenResult.claims. Submitted a PR that should fix the issue.

from next-firebase-auth.

kmjennison avatar kmjennison commented on May 18, 2024

Fixed in v0.13.0-alpha.4 and updated the live example app.

from next-firebase-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.