]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/users_controller.rb
Merge pull request #2485 from mmd-osm/patch/json2
[rails.git] / app / controllers / users_controller.rb
index 345bae2616607dde518f25de11b968ae8c08380e..514b3f8ee73f41d8d2284886ac11c1dde1addf47 100644 (file)
@@ -269,7 +269,7 @@ class UsersController < ApplicationController
   def logout
     @title = t "users.logout.title"
 
-    if params[:session] == session.id
+    if request.post?
       if session[:token]
         token = UserToken.find_by(:token => session[:token])
         token&.destroy
@@ -376,7 +376,7 @@ class UsersController < ApplicationController
     @user = User.find_by(:display_name => params[:display_name])
 
     if @user &&
-       (@user.visible? || (current_user&.administrator?))
+       (@user.visible? || current_user&.administrator?)
       @title = @user.display_name
     else
       render_unknown_user params[:display_name]