From d9d0babb2c424240dcf00daca3d2b163cd488bff Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 14 Aug 2017 19:08:52 +0200 Subject: [PATCH] Create a cookie token only if the user is anonymous --- app/controllers/packages_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/packages_controller.rb b/app/controllers/packages_controller.rb index 80ab8b6..4787312 100644 --- a/app/controllers/packages_controller.rb +++ b/app/controllers/packages_controller.rb @@ -26,9 +26,11 @@ class PackagesController < ApplicationController # POST target of the screenshots upload form. # Receives uploaded images. Checks if they are valid. Asks for description. + # This action saves the screenshots already if they are valid. The user is + # then given the chance to comment on and delete the screenshots again. def upload_receive # Send a cookie to remember the user by the cookie session. - create_user_token + create_user_token unless user_signed_in? @package = Package.find_by!(name: params[:name]) @valid_images = []