foreign-sapphire
foreign-sapphire2h ago

Auth Provider not working on Refine v5

This is my packages file. "dependencies": { "@emotion/cache": "^11.14.0", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", "@mui/base": "5.0.0-beta.70", "@mui/icons-material": "^6.5.0", "@mui/lab": "6.0.1-beta.36", "@mui/material": "^6.5.0", "@mui/system": "^6.2.1", "@mui/x-data-grid": "^6.11.2", "@mui/x-date-pickers": "^7.23.2", "@react-oauth/google": "^0.9.0", "@refinedev/cli": "^2.16.49", "@refinedev/core": "^5.0.4", "@refinedev/inferencer": "^6.0.1", "@refinedev/kbar": "^2.0.0", "@refinedev/mui": "^7.0.0", "@refinedev/nestjsx-crud": "^6.0.0", "@refinedev/nextjs-router": "^7.0.1", "@refinedev/react-hook-form": "^5.0.1", "@refinedev/supabase": "^6.0.0", "@tanstack/react-query": "^5.90.2", "apexcharts": "^3.41.1", "axios": "^1.3.4", "classnames": "2.3.2", "country-flag-icons": "^1.5.7", "css-mediaquery": "^0.1.2", "date-fns": "4.1.0", "js-cookie": "^3.0.5", "js-file-download": "^0.4.12", "lodash": "^4.17.21", "material-react-table": "2.0.4", "material-ui-popup-state": "5.0.9", "moment": "^2.29.4", "mui-tel-input": "^3.1.1", "next": "15.5.4", "pusher-js": "^8.0.2", "react": "19.2.0", "react-apexcharts": "^1.4.1", "react-awesome-lightbox": "^1.8.1", "react-date-range": "1.4.0", "react-dom": "19.2.0", "react-dropzone": "^14.2.3", "react-image-crop": "^11.0.10", "react-international-phone": "^4.6.0", "react-json-view": "^1.21.3", "react-phone-number-input": "^3.4.12", "react-show-more-text": "1.7.1", "react-simple-wysiwyg": "3.4.1", "tss-react": "^4.9.19", "use-file-picker": "^2.1.4" }, } If React version is 19, Auth Provider will not working (useLogin doesn't call the endpoint)
2 Replies
kapa.ai
kapa.ai2h ago
Hi @baeyang. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, Refine v5 is designed to be compatible with both React 18 and React 19. The official announcement and migration guides explicitly state that Refine v5 supports React 19, and you should be able to use authentication features, including the Auth Provider and hooks like useLogin, with React 19 without issues:
"We've upgraded to React 19 to keep you at the cutting edge of React development. ... With Refine v5, you can take advantage of better hydration performance, improved server components support, and enhanced concurrent rendering patterns."
"Refine v5 works seamlessly with both React 18 and 19"
Refine v5 announcement Your package versions (e.g., @refinedev/core@^5.0.4, @refinedev/mui@^7.0.0, react@19.2.0) are consistent with the required versions for React 19 support as outlined in the migration guide and announcement. If useLogin is not calling the endpoint, this is not a known or documented incompatibility between Refine v5 and React 19 in the official documentation or migration guides. In fact, the documentation provides examples of using useLogin and AuthProvider with the latest versions, and there are no notes about React 19 breaking these features Authentication Guide. Possible causes to investigate: - Ensure your AuthProvider is implemented according to the new v5 structure. Legacy auth providers and the v3 compatibility flag are no longer supported in v5 (Migration Guide). - Double-check that all Refine-related packages are updated to their v5+ versions, as mixing package versions can cause unexpected issues (Migration Guide). - There are no open or closed issues in the provided sources that confirm a general bug with AuthProvider or useLogin in React 19. Summary:
According to the official documentation and migration guides, AuthProvider and useLogin should work with React 19 in Refine v5. If you are experiencing issues, it is likely due to implementation details or a misconfiguration rather than a fundamental incompatibility. If the problem persists, consider creating a minimal reproduction and sharing it with the Refine team for further investigation, as suggested in similar issue threads. If you need help with your AuthProvider implementation, please share the relevant code for review. Refine v5 announcement
Migration Guide: 4.x.x to 5.x.x
Authentication Guide ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2h ago
<@1165838011972468829> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?