foodadvisor icon indicating copy to clipboard operation
foodadvisor copied to clipboard

seed.js: ADMIN_JWT_SECRET appended to existing line and yarn seed not copying images

Open Barokai opened this issue 2 years ago • 2 comments

Hi,

i just encountered that this line in https://github.com/strapi/foodadvisor/blob/master/api/script/seed.js#L100 (probably) causes the new variable ADMIN_JWT_SECRET to be appended in the same line as STRAPI_ADMIN_CLIENT_PREVIEW_SECRET which causes a non-working preview url.

tried it via unpublishing an article and then clicking the preview button, this was the response:

// 20220420084409
// http://localhost:3000/api/preview?secret=ARNFCb9zrC9ZHm5hZzCigWivD40icS4sADMIN_JWT_SECRET=68igkh9bvAKeIRqdFZ1lTZdldsxWBKIhVRq0lMz38SiuF5xws9i7+ZvEorNqRE9vB4FD4lro3hVfi4ozbwo+Pw==&slug=7-places-worth-visiting-for-the-food-alone&locale=en&apiID=article&kind=collectionType
{
  "message": "Invalid token"
}

Adding a & before ADMIN_JWT_SECRET or completely removing ADMIN_JWT_SECRET= and its value from the url solved the problem.

Furthermore, yarn seed seems to have problems on windows

yarn && yarn seed && yarn develop
yarn install v1.22.18
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.51s.
yarn run v1.22.18
$ node script/seed.js
Failed to move C:\strapi\foodadvisor\api\data\uploads to  public\uploads
Done in 1.27s.

My workaround was to copy the imagefiles from data.zip to public/uploads

Barokai avatar Apr 20 '22 07:04 Barokai

Hey! Same issu here with the yarn seed command and I do confirm that your workaround works. Thanks @Barokai

quentin-js avatar Oct 10 '22 07:10 quentin-js

Hello 👋 Thanks for this @Barokai. The issue will be fixed in the next merge. Also, for the public/uploads folder, it is in fact not working on Windows and we'll work on this!

Mcastres avatar Oct 10 '22 12:10 Mcastres