Skip to content

Bug: Login always redirects to /admin/dashboard regardless of user role #240

@pericharlabindhumadhavi-data

Description

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.jsxonSubmit 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.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions