Create a cookie token only if the user is anonymous

This commit is contained in:
Christoph Haas 2017-08-14 19:08:52 +02:00
parent c03be398f6
commit d9d0babb2c

View file

@ -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 = []