Comments (7)
I am getting six requests to the login and logout endpoints. This isn't just on dev but also when deployed to vercel in prod env (getting four on prod env). Strict mode is on in dev env.
from next-firebase-auth.
I had the same issue, but having this issue on a development server is not a problem until you experience the same thing with the optimized build. The reason behind you experiencing this issue might be related with strict mode ( causing two renders ) and using useEffect.
I hope this helps. 😊
from next-firebase-auth.
@yosipy, is this happening locally only?
Can you check if strictmode is active or not? https://nextjs.org/docs/pages/api-reference/next-config-js/reactStrictMode
from next-firebase-auth.
This is the deployed link sent by @yosipy
@RustedBuckett, it calls 2 times in dev if strict mode is on. But not sure why 6. Can I get any deployment or any link to code so that I can try to reproduce?
from next-firebase-auth.
Thanks for the issue. Could this be related to hot reloads or other dev-related rerenders?
#424 would serve as a band-aid fix, but it would be good to know the underlying cause here. Help wanted!
from next-firebase-auth.
Closing this as an expected behavior of React's strict mode:
To help you find accidentally impure code, Strict Mode calls some of your functions (only the ones that should be pure) twice in development.
However, implementing #424 would remove this behavior in development, too.
from next-firebase-auth.
Related Issues (20)
- Error when deploying to Versel
- 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
- 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
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.