Displaying 2 results from an estimated 2 matches for "password_is".
Did you mean:
password's
2006 Apr 14
7
SHA2 Issues
Hello all,
Thank you in advance for your help with this. I am trying to implement
the user authentication method from Ruby Recipes which calls for the use
of SHA 2. Here is the code for the password:
def password=(pass)
salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
self.password_salt, self.password_hash = salt,
Digest::SHA256.hexdigest(pass + salt)
end
I open
2008 May 30
6
Session problem
...in RoR and I am a complete
n00b ^^
Here''s my problem :
I need to get the user''s login stored in the session but for some
reason I cannot.
Here''s my login method code :
def login
if request.post?
@user = User.find_by_username(params[:login])
if @user and @user.password_is? params[:password]
session[:user] = @user.id
redirect_to :controller => ''games''
else
@auth_error = ''Wrong username or password''
end
end
end
And here''s the code of my GamesController. User needs to be logged in
to access th...