passive-yellow
passive-yellow•2y ago

Login-component

Hello team I am trying to setup a login component for a new project i am trying out in refine. Is there any detailed step by step guide. I was able to download example from github which works fine, but when i setup a new component it gives error,which as i understand shows like the data is not getting returned
27 Replies
Omer
Omer•2y ago
Hey @venkatasrikanths 👋, Welcome, we are glad to see you! Could you share more details? Error, code, etc. 🚀
fair-rose
fair-rose•2y ago
Following is the error message i am getting - Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ["getUserIdentity"] i copied the login page from task master example in my app
Omer
Omer•2y ago
Hmm could you share your getUserIdentity function of authProvider?
fair-rose
fair-rose•2y ago
const mockUsers = [{ username: "admin" }, { username: "editor" }]; const authProvider = { login: ({ username, password, remember }:{username:string, password:string, remember:boolean}) => { // Suppose we actually send a request to the back end here. const user = mockUsers.find((item) => item.username === username); if (user) { localStorage.setItem("auth", JSON.stringify(user)); return Promise.resolve("/posts"); } return Promise.reject(); }, register: () => Promise.resolve(), forgotPassword: () => Promise.resolve(), updatePassword: () => Promise.resolve(), logout: () => Promise.resolve(), checkAuth: () => Promise.resolve(), checkError: () => Promise.resolve(), getPermissions: () => Promise.resolve(), getUserIdentity: () => Promise.resolve({ name: "admin" }) }; export default authProvider;
Omer
Omer•2y ago
No issue appears here. Which example did you copy?
fair-rose
fair-rose•2y ago
Create Your Easy Customizable Internal Issue Tracker With Refine an...
This web application will us to create issue and tasks for your team members. You will also be able to choose the priority of these tasks, their tags, and which person to assign them to.
Omer
Omer•2y ago
GitHub
refine/examples/authentication/antd at next · pankod/refine
Build your React-based CRUD applications, without constraints. - refine/examples/authentication/antd at next · pankod/refine
fair-rose
fair-rose•2y ago
Sure will give a try and update you
Omer
Omer•2y ago
Thank you for your patiance. We will investigate the example you forwarded tomorrow.
fair-rose
fair-rose•2y ago
Any easy way to share code with you
Omer
Omer•2y ago
I'm sure this example will work 🙂
fair-rose
fair-rose•2y ago
thanks
Omer
Omer•2y ago
Did it work? 👀
fair-rose
fair-rose•2y ago
i am trying to running in stackblitz and somehow the UI is not loading up Will try and let you know I tried the example give by you as well. it doesnt seem to work for me