Skip to content
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

missing attribute: encrypted_otp_secret #232

Open
spyrosavl opened this issue Jan 10, 2023 · 0 comments
Open

missing attribute: encrypted_otp_secret #232

spyrosavl opened this issue Jan 10, 2023 · 0 comments

Comments

@spyrosavl
Copy link

I am using devise-two-factor in a Rails 6 application. However, I have the following issue.
If I do a select without including encrypted_otp_secret attributes, I get the following error:

ActiveModel::MissingAttributeError: missing attribute: encrypted_otp_secret
from /usr/local/bundle/gems/activemodel-6.1.4.1/lib/active_model/attribute.rb:222:in `value'

The error can be reproduced by running:
User.select(:email).first.to_json
But works if I do:
User.select(:email, :encrypted_otp_secret, :encrypted_otp_secret_iv, :encrypted_otp_secret_salt).first.to_json

I suppose there is an after_commit callback running and causing the issue. Is this expected? Is there a way around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant