current_user.password = nil ? #107

Closed
jtzero opened this Issue Sep 26, 2012 · 4 comments

Projects

None yet

3 participants

@jtzero
jtzero commented Sep 26, 2012

attr_accessible :username, :password, :password_confirmation, :remember_me

puts curent_user.password

renders nothing (password nil)
however current_user.username still resolves to the correct name
Sorry about the lack of info, my concept of what was wrong behind the scenes changed so I will have to get more info.
Ok, backing up a little, i needed the password to compliment issue #94
I got it work applying the patch and
migration:

t.string :password, :null => false, :default => ""
#t.string :encrypted_password, :null => false, :default => ""

from model.rb, removed the

def password=(new_password)
  @password = new_password
end

and to line 95 added

resource.password = attributes[:password] if resource.password.nil? and !attributes[:password].nil?

which gave me access to the password as current_user[:password]

then could use

current_user.get_ldap_param(current_user.login_with, current_user[:password], 'mail')
@jtzero jtzero closed this Sep 26, 2012
@jtzero jtzero reopened this Sep 26, 2012
@ouranos
ouranos commented Jan 3, 2013

Wouldn't that store the clear password in the database though ?

@cschiewek
Owner

Yes it would. Why would you want to persist the password? Why would you even want to display it? I can't see a sane use case for this, so I'm closing it.

@cschiewek cschiewek closed this Jul 2, 2013
@jtzero
jtzero commented Jul 3, 2013

"I can see a sane use case for this" - there isn't, I accidentally reopened this, it was a "fix" for something else designed wrong, and became a "forest for the trees" type deal, sorry about that

@cschiewek
Owner

No worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment