Assign role after login #2150
Unanswered
fornaserofranco
asked this question in
Q&A
Replies: 1 comment
-
Really weird |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am implementing roles in a website where there is already a database with many users, so assigning roles one by one is not feasible. It occurred to me to assign a role to the user after they log in, but I can't get it to work. Could you tell me what is wrong with my code?
This is my login controller
The error I get is:

I already have HasRole in my model user and was able to assign a role to a user in a seeder the way I'm trying to do now
Beta Was this translation helpful? Give feedback.
All reactions