Skip to content

Commit

Permalink
Fixed logout with port
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Mar 26, 2013
1 parent bbed8e0 commit 1696d37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ def create
end
end

# Logout
def destroy
port = request.port == 80 ? '' : ":#{request.port}"
if @user_session = UserSession.find
@user_session.destroy
reset_session
#flash.now[:notice] = _("Successfully logged out.")
redirect_to "http://#{current_site.host}#{params[:redirect] || home_path(:prefix => prefix)}"
redirect_to "http://#{host_with_port}#{params[:redirect] || home_path(:prefix => prefix)}"
else
redirect_to "http://#{current_site.host}#{home_path(:prefix => prefix)}"
redirect_to "http://#{host_with_port}#{home_path(:prefix => prefix)}"
end
end

Expand Down

0 comments on commit 1696d37

Please sign in to comment.