From 27a8e0fbca12cf203a773c6f4a3f8ea07182f75d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 10 Oct 2015 12:27:19 +0200 Subject: [PATCH] Test if user is nil in #reset_authentication_token Actually it redirects to stream page and says that user is already logged in. Fix https://github.com/diaspora/diaspora/issues/6326 --- app/controllers/sessions_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 05016d2a7..61f464209 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -7,6 +7,6 @@ class SessionsController < Devise::SessionsController before_filter :reset_authentication_token, :only => [:destroy] def reset_authentication_token - current_user.reset_authentication_token! + current_user.reset_authentication_token! unless current_user.nil? end end