I''m having a bit of trouble with the salted login generator... the link sent in the verification email doesn''t set the verification value to 1. As far as I can tell, the user.rb model should be setting this in update_expiry after trying to self.authenticate_by_token(id, token); but I''m not sure if this is being called (and am not quite sure how to check this). I''ve checked the database, and the token being sent out does match the token in the users table. I''m new to both Ruby and Rails. Using Salted Login Generator 1.0.9, latest public version of Rails (0.12.1), Ruby 1.8.2. Running on MySQL 4.1.12-standard / WEBrick / OSX 10.4.1. I''d appreciate any help I can get on this. Thanks, Dave -- Site: http://dave.antidisinformation.com/
Joseph Hosteny
2005-Jun-06 12:41 UTC
Re: Verification not working with salted login generator
On Jun 5, 2005, at 10:25 PM, David Barrett wrote:> I''m having a bit of trouble with the salted login generator... the > link sent in the verification email doesn''t set the verification value > to 1. As far as I can tell, the user.rb model should be setting this > in update_expiry after trying to self.authenticate_by_token(id, > token); but I''m not sure if this is being called (and am not quite > sure how to check this). >Typically, this has been one of two problems. The first is that the database and the session get out of sync, e.g., if you recreate the database without removing the session files in /tmp. To fix this, just stop the server, remove these files and restart. The other I have seen is that the before_filter is not set up, so the actual method to set the ''verified'' bit is never called. At the very least, the account controller itself requires authentication of its actions via "before_filter :login_required." That can be in the base ApplicationController class, or you can put it in the account controller itself.> I''ve checked the database, and the token being sent out does match the > token in the users table. > > I''m new to both Ruby and Rails. Using Salted Login Generator 1.0.9, > latest public version of Rails (0.12.1), Ruby 1.8.2. Running on MySQL > 4.1.12-standard / WEBrick / OSX 10.4.1. > > I''d appreciate any help I can get on this. >If neither of those hints helps you, drop me a line and we should be able to work through it. -joe> Thanks, > Dave > > -- > Site: http://dave.antidisinformation.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Joseph Hosteny jhosteny-ee4meeAH724@public.gmane.org H: 412.362.8672 C: 412.418.6023
David Barrett
2005-Jun-06 13:09 UTC
Re: Verification not working with salted login generator
Adding: before_filter :login_required, :except => [ :login, :signup, :forgot_password ] To the user_controller.rb solved the problem (I also deleted the session, but this by itself did nothing). Thanks Joseph. Is there anything else I should be adding to the :except option? I assume I don''t need to add the protected methods to it, is this correct? Thanks again, Dave On 6/6/05, Joseph Hosteny <jhosteny-ee4meeAH724@public.gmane.org> wrote:> > On Jun 5, 2005, at 10:25 PM, David Barrett wrote: > > > I''m having a bit of trouble with the salted login generator... the > > link sent in the verification email doesn''t set the verification value > > to 1. As far as I can tell, the user.rb model should be setting this > > in update_expiry after trying to self.authenticate_by_token(id, > > token); but I''m not sure if this is being called (and am not quite > > sure how to check this). > > > > Typically, this has been one of two problems. The first is that the > database and the session get out of sync, e.g., if you recreate the > database without removing the session files in /tmp. To fix this, > just stop the server, remove these files and restart. > > The other I have seen is that the before_filter is not set up, so the > actual method to set the ''verified'' bit is never called. At the very > least, the account controller itself requires authentication of its > actions via "before_filter :login_required." That can be in the base > ApplicationController class, or you can put it in the account > controller itself. > > > I''ve checked the database, and the token being sent out does match the > > token in the users table. > > > > I''m new to both Ruby and Rails. Using Salted Login Generator 1.0.9, > > latest public version of Rails (0.12.1), Ruby 1.8.2. Running on MySQL > > 4.1.12-standard / WEBrick / OSX 10.4.1. > > > > I''d appreciate any help I can get on this. > > > > If neither of those hints helps you, drop me a line and we should be > able to work through it. > > -joe > > > Thanks, > > Dave > > > > -- > > Site: http://dave.antidisinformation.com/ > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > Joseph Hosteny > jhosteny-ee4meeAH724@public.gmane.org > H: 412.362.8672 > C: 412.418.6023 > >-- Site: http://dave.antidisinformation.com/