diaspora/app/controllers/sessions_controller.rb
Marien Fressinaud 27a8e0fbca 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
2016-02-21 04:24:50 +01:00

12 lines
456 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class SessionsController < Devise::SessionsController
after_filter :reset_authentication_token, :only => [:create]
before_filter :reset_authentication_token, :only => [:destroy]
def reset_authentication_token
current_user.reset_authentication_token! unless current_user.nil?
end
end