I’m currently working on a project using Laravel 10 and Sanctum for authentication. I’m having some trouble implementing authentication and could use some assistance.
Here’s a summary of what I’m trying to achieve:
Authentication Types: I have three different roles: admin, instructor, and student.
Routes: I have separate login endpoints for each role, all handled by different methods in the LoginController and RegisterController.
Current Issue: I’m struggling with correctly setting up the authentication logic for each role and ensuring that users are redirected to the correct dashboard based on their role.
Thank you in advance for your help!
Best regards,
Ridha
Specific Issues:
Properly configuring Sanctum for role-based authentication.
Ensuring correct redirection after login based on user role.
Handling session-based authentication with transient tokens.
I would greatly appreciate any guidance or suggestions on how to resolve these issues. If there are any best practices or resources you recommend, that would be incredibly helpful as well.
1