Describe the bug
After a successful login (both regular and Google login), the app
always redirects to /admin/dashboard regardless of the user's role.
navigate("/admin/dashboard"); // hardcoded in both login handlers
If a non-admin user logs in, they are incorrectly sent to the
admin dashboard.
Where is it happening
src/pages/public/Login.jsx — onSubmit and handleGoogleLogin functions
Expected behavior
The redirect after login should be based on the user's role
returned in the API response. For example:
- Admin role →
/admin/dashboard
- Customer role →
/ or customer view
Suggested Fix
Check the roles array from the login response and redirect
accordingly instead of hardcoding /admin/dashboard.
I would like to work on this issue under GSSoC.
Please assign this issue to me.
Thank you.
Describe the bug
After a successful login (both regular and Google login), the app
always redirects to
/admin/dashboardregardless of the user's role.If a non-admin user logs in, they are incorrectly sent to the
admin dashboard.
Where is it happening
src/pages/public/Login.jsx—onSubmitandhandleGoogleLoginfunctionsExpected behavior
The redirect after login should be based on the user's role
returned in the API response. For example:
/admin/dashboard/or customer viewSuggested Fix
Check the
rolesarray from the login response and redirectaccordingly instead of hardcoding
/admin/dashboard.I would like to work on this issue under GSSoC.
Please assign this issue to me.
Thank you.