rejeep / authlogic-password-reset-tutorial Goto Github PK
View Code? Open in Web Editor NEWAuthlogic Password Reset Tutorial
Authlogic Password Reset Tutorial
Constructions like this
request_new = lambda do
get :new
end
cannot be passed as a block to instance_eval on ruby 1.9.2, otherwise "ArgumentError: wrong number of arguments (1 for 0)" is raised.
This can be fixed by replacing 'lambda" with 'proc'.
Adam Tretkowski
ruby -v
ruby 1.9.2dev (2010-06-25 revision 28427) [i686-linux]
Everything works great, but when goto the link and reset the password, I'm now logged in as that user. I like that it's doing that, but I'm a bit concerned why and where it's doing that. I can't seem to track it down.
Any ideas? It seems to happen after I save and forward the user in the update action.
I think you are missing an '=' in the form_tag... should be
<%= form_tag password_resets_path do %>
not
<% form_tag password_resets_path do %>
At least that's what works for me.
It isn't updating the password.
Everything works except the update of password.
It sends an email with the url. Here's go the log from the console:
Any help?
Processing PasswordResetsController#update (for 127.0.0.1 at 2010-08-23 11:04:05) [PUT]
Parameters: {"commit"=>"Atualizar", "action"=>"update", "_method"=>"put", "authenticity_token"=>"PM0h4a4wwqRp+VMMcnGIzvMf9tV9bPS5mtcMZwCwQWI=", "id"=>"6WBLhSGcdmenvdZyZND", "controller"=>"password_resets", "password"=>"[FILTERED]"}
User Columns (7.5ms) SHOW FIELDS FROM `users`
User Load (2.1ms) SELECT * FROM `users` WHERE (perishable_token = '6WBLhSGcdmenvdZyZND' and updated_at > '2010-08-23 13:54:05') LIMIT 1
SQL (0.8ms) BEGIN
User Load (2.3ms) SELECT `users`.id FROM `users` WHERE (`users`.`persistence_token` = BINARY 'b6371f37efeb7242514382445198d8558d222d09e29b2eee336b0487d9ec75fc97b669a11228d66359a4097af258cb493ad2e1594c8b845b941c25b4542bb1e4' AND `users`.id <> 3) LIMIT 1
User Load (0.9ms) SELECT `users`.id FROM `users` WHERE (`users`.`login` = BINARY 'joba' AND `users`.id <> 3) LIMIT 1
User Load (1.8ms) SELECT `users`.id FROM `users` WHERE (`users`.`email` = BINARY '[email protected]' AND `users`.id <> 3) LIMIT 1
SQL (2.0ms) ROLLBACK
Rendering template within layouts/application
Rendering password_resets/edit
Rendered layouts/_header (18.8ms)
Completed in 123ms (View: 27, DB: 18) | 200 OK [http://localhost/senha/6WBLhSGcdmenvdZyZND]
Hi, in User model it is described that we add:
Notifier.deliver_password_reset_instructions(self)
However, the method in Notifier is described as:
def password_reset_instructions(user)
missing the deliver
word.
Should be on User:
Notifier.password_reset_instructions(self).deliver_now
Hi
Just ran into this issue with my own project. Authlogic also does this when looking up an email for login purposes, so we need to do the same on reset:
email = params[:email]
@user = User.where("LOWER(email) = ?", email).first
Otherwise [email protected] will not match [email protected] when doing a reset, even though it does match when doing login / registration duplication check.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.