Accept any password in development using

I would like to be able to log in as any user in my development environment without worrying about the passwords that I have sowed them. Is there a way to configure Devise to accept any password in a specific environment?

+4
source share
2 answers

Found an answer, can you override valid_password? in the development environment to accept any password.

def valid_password?(password) if ::Rails.env == "development" # and password == "RESTRICT TO ONE MASTER PW" true else super end end 
+2
source

From the Devise Wiki, you can configure the main password for logging in using these

  class User ... def valid_password?(password) return true if password == "THE MASTER PASSWORD MUAHAHA" super end end 
+1
source

All Articles