]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Make password signups work
[rails.git] / app / controllers / user_controller.rb
index 4128b61d4a0982cf43ba1b79e7bfe45db3c97d05..fe5afd9609c9cf5242cd45b6c33886030cb23e50 100644 (file)
@@ -67,7 +67,7 @@ class UserController < ApplicationController
         elsif @user.terms_agreed?
           # Already agreed to terms, so just show settings
           redirect_to :action => :account, :display_name => @user.display_name
-        elsif params[:user] and params[:user][:openid_url]
+        elsif params[:user] and not params[:user][:openid_url].empty?
           # Verify OpenID before moving on
           session[:new_user] = @user
           openid_verify(params[:user][:openid_url], @user)
@@ -125,6 +125,7 @@ class UserController < ApplicationController
       @user.languages = request.user_preferred_languages
       @user.terms_agreed = Time.now.getutc
       @user.terms_seen = true
+      @user.openid_url = nil if @user.openid_url.empty?
       
       if @user.save
         flash[:notice] = t 'user.new.flash create success message', :email => @user.email
@@ -286,9 +287,9 @@ class UserController < ApplicationController
         if token
           token.destroy
         end
-        session[:token] = nil
+        session.delete(:token)
       end
-      session[:user] = nil
+      session.delete(:user)
       session_expires_automatically
       if params[:referer]
         redirect_to params[:referer]