Create a cookie token only if the user is anonymous
This commit is contained in:
parent
c03be398f6
commit
d9d0babb2c
1 changed files with 3 additions and 1 deletions
|
|
@ -26,9 +26,11 @@ class PackagesController < ApplicationController
|
||||||
|
|
||||||
# POST target of the screenshots upload form.
|
# POST target of the screenshots upload form.
|
||||||
# Receives uploaded images. Checks if they are valid. Asks for description.
|
# 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
|
def upload_receive
|
||||||
# Send a cookie to remember the user by the cookie session.
|
# 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])
|
@package = Package.find_by!(name: params[:name])
|
||||||
@valid_images = []
|
@valid_images = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue