devise
devise copied to clipboard
Rails 7.0 Sign Up no more saving password on alias column
Environment
- Ruby [3.1.2]
- Rails [7.0.2]
- Devise [4.8.1]
- Database postgresql
Premise
Hello, i'm facing a problem linked to registrations: In my app i need to have, or better, must have as main password column a column called Password ( with capitalized P).
Expected behavior
So I found a workaround using an alias_attribute like that:
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :validatable, :encryptable, encryptor: :sha512
alias_attribute :encrypted_password, :Password
It worked good and my password with sha512 hash was correctly stored in the targeted column Password.
Current behavior
Now, after updating Rails v i found out that this Password column is not filled anymore with encrypted_password.
Conclusions:
This solution worked until i changed from rails 6.1 to rails 7, or better, until i changed config.load_defaults from 6.1 to 7.0
Let me know if you need more details, thanks