-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
current_user should not be limited to ActiveRecord::Base class #3192
Comments
I ran into something similar (i.e. |
Yes. We agree. That shouldn't be tied to |
Sounds good. I wonder if Literal's InterfaceType could be better? https://github.com/joeldrapper/literal/blob/2e3ee130e9f894c3b6e3c0d2763f760e801f6ad2/lib/literal/types/interface_type.rb#L4 |
That would be great if we actually enforced anything. But thanks for pointing that out. We stil have a few things to learn about literal. |
Describe the bug
Avo 3.11.8 introduced a change which checks if
current_user
has theActiveRecord::Base
class. PR #3102. This breaks authentication schemes which don't use AR and setcurrent_user
using custom code (e.g. from HTTP Basic Auth).avo/app/components/avo/sidebar_profile_component.rb
Lines 3 to 4 in 3a12d4a
Steps to Reproduce
Code sample:
/config/initializers/avo.rb
:/app/avo/concerns/avo_current_user.rb
:Expected behavior & Actual behavior
Custom
current_user
should work as long as it implements required readers (e.g.name
). However starting with Avo 3.11.8 it fails with a error:Models and resource files
N/A.
System configuration
Avo version: 3.11.8+
Rails version: 7.2.1
Ruby version: 3.1.6
License type:
Are you using Avo monkey patches, overriding views or view components?
Screenshots or screen recordings
N/A.
Additional context
N/A.
Impact
Urgency
The text was updated successfully, but these errors were encountered: