Getting an undefined method error 'valid_password?' with authlogic

I suddenly get the error below on my server using Authlogic

NoMethodError (undefined method `valid_password?' for #<ProductionHouse:0xb53859cc>): authlogic (2.1.3) [v] lib/authlogic/session/password.rb:191:in `send' authlogic (2.1.3) [v] lib/authlogic/session/password.rb:191:in `validate_by_password' authlogic (2.1.3) [v] lib/authlogic/session/callbacks.rb:72:in `validate' authlogic (2.1.3) [v] lib/authlogic/session/validation.rb:64:in `valid?' authlogic (2.1.3) [v] lib/authlogic/session/existence.rb:65:in `save' app/controllers/user_session_controller.rb:162:in `create' pdfkit (0.5.1) lib/pdfkit/middleware.rb:16:in `call' 

Could a problem suddenly arise? Does anyone know about this, please help?

+6
source share
1 answer

I get this error if I start the web server (in my Thin case) before the database is available (in my case MySQL is not working, for example).

I download the application in my browser and it complains that MySQL is not working, so I start MySQL, I will return to the application that is loading correctly now, but will not allow me to log in (I get the error described by OP).

If I now start and restart the web server and try again, I can log in without errors.

Presumably valid_password? is a method that is added to the model at boot time and depends on the available database.

+3
source

Source: https://habr.com/ru/post/897286/


All Articles