Roles won't stick #2176
-
This one is driving us crazy, and we're not sure what's causing it. We're using Laravel 9.29 via Laravel Octane w/ Swoole and about every 10-20 minutes, all users get assigned the "Guest" role (basically our placeholder role for no permissions). Trying to reassign the role gets reverted about 10-20 minutes later. There's no scheduled task that could be doing this. We've tried messing with cache and re-examined all of our auth logic to make sure errant users aren't getting reassigned roles. We've even tried overriding the syncRoles() and assignRole() methods to try to catch what's doing it and nothing was caught but the roles were reverted. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
It looks like you broke something in your implementation.
nobody could tell you which part you broke |
Beta Was this translation helpful? Give feedback.
-
So after altering the table to have an auto incrementing Unless, perhaps, I missed it in the docs somewhere looks like either a bug or undocumented intended behavior. |
Beta Was this translation helpful? Give feedback.
So after altering the table to have an auto incrementing
id
column (whereas before thetoken
column, which had the unique constraint but not the auto increment one), the issue went away. Also resolved another issue where it would complain role rows weren't unique.Unless, perhaps, I missed it in the docs somewhere looks like either a bug or undocumented intended behavior.