-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiples Profiles Relationship #1168
Comments
@betosalvador Check https://github.com/lynndylanhurley/devise_token_auth/blob/master/docs/usage/routes.md. You have to add the next code for each model: mount_devise_token_auth_for 'Employee', at: '/api/v1/employees', controllers: {
registrations: 'api/v1/employees/registrations',
sessions: 'api/v1/sessions',
} As you can see in the example, it's for |
Hello @MaicolBen, thanks for response. My model Employee don't is a Devise model. I have just one Devise model: "User". Do you think that your suggestion solve my case? hugs |
@MaicolBen , just more one question: I have namespaces configured in my routes, like:
Do you think better call mount_devise_token_auth_for method inside or outside namespaces? thanks in advance |
I made the suggested test, but the only route generated was /api/v1/employees/validate_token could you please open my issue again? thanks again |
please, reopen my issue |
Reopening, but it seems more a question than an issue. I need time to setup your problem locally and try a different solution. |
Hello @MaicolBen thank you very much. Actually, I created differents controllers for registration of each user type (EmployersControllers, EmployeesControllers, OperatorsControllers). All this user types has a User record, with the login data, like I said before. So, I'm using the default route to SignIn all user types (POST "/auth/sign-in"). I need now to return the user role (Employer, Employee or Operator) on SignIn to the fronEnd. So, that way, I will make some authorizations. I would like to know if is this a good approach? Thanks in advance! |
Yes, that's what I said, a controller for each model like |
Hello @MaicolBen thanks for your reponse |
Hello everyone
I'm working on a system where the user can be a Employer, Employee or a Operator.
Each theese roles must have a model class, where I will implement specific behaviors.
All theese classes must have a login user.
So, I think that this solution could work:
I want to create specifics registrations controllers, for each profile (EmployerController, EmployeeController, OperatorController), because each registration may have different behaviors.
And I want to use the default SigiIn controller for all profiles.
How to configure the routes for this?
Thanks in advance
The text was updated successfully, but these errors were encountered: