]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/users_controller.rb
Delete any outstanding tokens when a user changes their email
[rails.git] / app / controllers / users_controller.rb
index aa115a2282fee7b3072f73f46b07cb94fe7f3f6b..e5a57f47ef85439262c727db842570ede3d6a2b6 100644 (file)
@@ -366,7 +366,7 @@ class UsersController < ApplicationController
         else
           flash[:errors] = current_user.errors
         end
-        token.destroy
+        current_user.tokens.delete_all
         session[:user] = current_user.id
         redirect_to :action => "account", :display_name => current_user.display_name
       elsif token