Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Password validation skip #23

Open
woto opened this issue May 5, 2010 · 2 comments
Open

Password validation skip #23

woto opened this issue May 5, 2010 · 2 comments

Comments

@woto
Copy link

woto commented May 5, 2010

Hi, sorry for bad English. (in this app rails-authlogic-rpx-sample - http://rails-authlogic-rpx-sample.heroku.com/)
Is there best way to validate passwords? For now if you will log through rpx (not standart registration) and go to profile page and change for example password on 1 letter and does't changhe password_confirmation then validation of password skips. For now i've made workaround

def validate_password_not_rpx?
  !session_class.controller.params[:user][:password].blank? or !session_class.controller.params[:user][:password_confirmation].blank?
end

i think there is the best way?

@tardate
Copy link
Owner

tardate commented May 11, 2010

hi @woto, thanks for the suggestion. I'll look into this and see if we can make it an 'automatic' behaviour

@woto
Copy link
Author

woto commented May 12, 2010

Hi, working solution in my app looks like this

def validate_password_not_rpx?
  #super
  begin
    ps1 = session_class.controller.params[:user][:password]
  rescue
    ps1 = ""
  end

  begin
    ps2 = session_class.controller.params[:user][:password_confirmation]
  rescue
    ps2 = ""
  end

  if (new_record? || (ps1.any? || ps2.any?)) then
    return true
  else
    return false
  end
end

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

No branches or pull requests

2 participants