Forum: Ruby on Rails Salted Login Generated code throwing lots of errors

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
967f758fa9de78e7fe8425469f7a7acc?d=identicon&s=25 David Barrett (Guest)
on 2005-12-31 02:59
(Received via mailing list)
Hi,

I'm having a lot of problems while integrating the salted login
generator. All of the errors are of the form:
"The error occured while evaluating nil.[]"

Most seem to be down to evaluating a nested hash, where the first hash
is a nil object. For example, @params['user']['login'] where
@params['user'] returns the nil object. This method in particular is
annoying me:

   def login
     generate_blank
     @user = User.new(@params['user'])
     if @session['user'] = User.authenticate(@params['user']['login'],
@params['user']['password'])
       flash['notice'] = l(:user_login_succeeded)
       redirect_back_or_default :action => 'welcome'
     else
       @login = @params['user']['login']
       flash.now['message'] = l(:user_login_failed)
     end
   end

This craps out on the line:
     if @session['user'] = User.authenticate(@params['user']['login'],
@params['user']['password'])
and the line:
       @login = @params['user']['login']

Is there any way I can fix this problem without a lot of dull re-coding?

I'm using the Rails 0.14.4 and salted_login_generator 1.1.1

Dave

--
Site: http://antidis.com/
This topic is locked and can not be replied to.