Acts_as_authenticated strangeness

hi
the strangest thing is happening. on my local machine
acts_as_authenticated works fine, but whe on the server [dreamhost] it
refuses to log in. no error messages. nothing. just reloads the login
page again.

here`s my action:

def login
return unless request.post?
flash[:notice] = “Incorrent login”
self.current_user = User.authenticate(params[:login],
params[:password])
if logged_in?
session[:username] = params[:login]
user=User.find_by_login(params[:login])
session[:role]=user.organisation
session[:user_id]=user.id
if params[:remember_me] == “1”
self.current_user.remember_me
cookies[:auth_token] = { :value =>
self.current_user.remember_token , :expires =>
self.current_user.remember_token_expires_at }
else
flash[:notice] = “Logged in successfully”
end
redirect_back_or_default(:controller => ‘/event’, :action =>
‘calendar’)
flash[:notice] = “Logged in successfully”
end
end

any ideas? or anyone experienced something similar?

mr_robot wrote:

hi
the strangest thing is happening. on my local machine
acts_as_authenticated works fine, but whe on the server [dreamhost] it
refuses to log in. no error messages. nothing. just reloads the login
page again.

any ideas? or anyone experienced something similar?

Have you migrated/created your user table to the server?

jp

yes. if i search for the user in console, not problem. and the
database on the server is an exact copy of the one on my local machine.

the strange thing is really why ut’s goin back to login, and with no
error/flash message

Perhaps you’re running in production mode [like you should be on the
server]
and haven’t restarted the dispatchers, so they’re still running on the
old
code.

RSL

mr_robot wrote:

the strange thing is really why ut’s goin back to login, and with no
error/flash message

Maybe there’s some funkiness going on with a cookie, have you cleared
them and/or restarted your browser?


Chris M.
Web D.
http://chriscodes.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs