Skip to content
This repository

How To: Configure a master password 

seuros edited this page · 8 revisions

Pages 110

Clone this wiki locally

If you need a super password to be able to log in as one of your users, you can add this code to your models:

class User
  def valid_password?(password)
     if Rails.env.development?
      return true if password == "THE MASTER PASSWORD MUAHAHA" 

It barely needs mentioning, but just in case - This is extremely dangerous for a production app... Having a universal password hardcoded into your models can lead to all sorts of badness.

Something went wrong with that request. Please try again.