]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/users_controller.rb
Bump actions/checkout from 2.3.5 to 2.4.0
[rails.git] / app / controllers / users_controller.rb
index ec30eb4e7b14a3267b44dfcbd0386939c83009f9..38a61208c4635120ea9864a65dfd360728914baa 100644 (file)
@@ -28,9 +28,9 @@ class UsersController < ApplicationController
 
       if current_user&.terms_agreed?
         # Already agreed to terms, so just show settings
-        redirect_to :action => :account, :display_name => current_user.display_name
+        redirect_to user_account_path(current_user)
       elsif current_user.nil? && session[:new_user].nil?
-        redirect_to :action => :login, :referer => request.fullpath
+        redirect_to login_path(:referer => request.fullpath)
       end
     end
   end
@@ -47,7 +47,7 @@ class UsersController < ApplicationController
         if params[:referer]
           redirect_to safe_referer(params[:referer])
         else
-          redirect_to :action => :account, :display_name => current_user.display_name
+          redirect_to user_account_path(current_user)
         end
       elsif params[:decline]
         redirect_to t("users.terms.declined")
@@ -67,7 +67,7 @@ class UsersController < ApplicationController
       if params[:referer]
         redirect_to safe_referer(params[:referer])
       else
-        redirect_to :action => :account, :display_name => current_user.display_name
+        redirect_to user_account_path(current_user)
       end
     else
       self.current_user = session.delete(:new_user)
@@ -147,7 +147,7 @@ class UsersController < ApplicationController
     current_user.data_public = true
     current_user.save
     flash[:notice] = t "users.go_public.flash success"
-    redirect_to :action => "account", :display_name => current_user.display_name
+    redirect_to user_account_path(current_user)
   end
 
   def new
@@ -277,15 +277,15 @@ class UsersController < ApplicationController
     name = auth_info[:info][:name]
     email = auth_info[:info][:email]
 
-    case provider
-    when "openid"
-      email_verified = uid.match(%r{https://www.google.com/accounts/o8/id?(.*)}) ||
+    email_verified = case provider
+                     when "openid"
+                       uid.match(%r{https://www.google.com/accounts/o8/id?(.*)}) ||
                        uid.match(%r{https://me.yahoo.com/(.*)})
-    when "google", "facebook"
-      email_verified = true
-    else
-      email_verified = false
-    end
+                     when "google", "facebook"
+                       true
+                     else
+                       false
+                     end
 
     if settings = session.delete(:new_user_settings)
       current_user.auth_provider = provider
@@ -297,7 +297,7 @@ class UsersController < ApplicationController
 
       session[:user_errors] = current_user.errors.as_json
 
-      redirect_to :action => "account", :display_name => current_user.display_name
+      redirect_to user_account_path(current_user)
     elsif session[:new_user]
       session[:new_user].auth_provider = provider
       session[:new_user].auth_uid = uid
@@ -341,17 +341,6 @@ class UsersController < ApplicationController
 
   private
 
-  ##
-  #
-  def unconfirmed_login(user)
-    session[:token] = user.tokens.create.token
-
-    redirect_to :action => "confirm", :display_name => user.display_name
-
-    session.delete(:remember_me)
-    session.delete(:referer)
-  end
-
   ##
   # update a user's details
   def update_user(user, params)