Comments (6)
FYI, I downgraded to 0.12.2, no issue with this version in case someone is facing the same issue.
from next-firebase-auth.
Same problem here, works with alpha.0
from next-firebase-auth.
This problem starts in 0.13.0-alpha.2
from next-firebase-auth.
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.
@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.
Fixed in v0.13.0-alpha.4 and updated the live example app.
from next-firebase-auth.
Related Issues (20)
- Error: Invalid next-firebase-auth options: The "FIREBASE_AUTH_EMULATOR_HOST" environment variable should be the same as the host set in the config
- Add metaData / user data to AuthUser object HOT 4
- Why is databaseURL required during init? HOT 1
- Deploying on Vercel leads to 500 error for ssr-auth-required and ssr-no-token HOT 6
- Infinite rediect to login page when deploy to vercel
- When using 'next dev', two requests are sent to /login or /logout HOT 7
- Auth lost on refresh / navigation, but user stays logged in HOT 1
- firebaseAuthEmulatorHost is ignored and requests to live servers are made HOT 7
- Can I use this library with firebase latest version of firebase. HOT 2
- IdToken not being set as authorization header in axios interceptor on page load.
- Improve setAuthCookies types to no be necessary passing an empty object when not setting the token HOT 1
- Next 14 support HOT 1
- next-firebase-auth must be initialized before rendering. HOT 2
- TypeError: u[v] is not a function. (In 'u[v](x)', 'u[v]' is null)
- How to resolve the return type of getServerSideProps?
- Can't use firebase apps in getServerSideProps: "FirebaseError: Firebase: Need to provide options, when not being deployed to hosting via source." HOT 1
- Q: Anyway to use the login from a different nextJs app on the same domain?
- Add support for firebase-admin v12
- "Missing or insufficient permissions" when upgrading above 9.16.0 HOT 2
- Initialization takes 30 seconds with the error "Uncaught TypeError: u[v] is not a function" in Chrome for mobile devices HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-firebase-auth.