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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
David B. (Guest)
on 2005-12-31 03:59
(Received via mailing list)

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
     @user =['user'])
     if @session['user'] = User.authenticate(@params['user']['login'],
       flash['notice'] = l(:user_login_succeeded)
       redirect_back_or_default :action => 'welcome'
       @login = @params['user']['login']['message'] = l(:user_login_failed)

This craps out on the line:
     if @session['user'] = User.authenticate(@params['user']['login'],
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


This topic is locked and can not be replied to.