Role Selection on Login Page in Frappe

I want to add a feature to my Frappe app’s login page where users must select their category or role profile before logging in.

When a user selects a role (e.g., "Student," "Teacher," or "Admin"), they should be redirected to the respective dashboard.
If a user has multiple roles, they should be able to choose one at login, and access should be granted accordingly.
The selected role should be applied to their session automatically.
The system should assign the selected role to the logged-in user for that session.