strapi / foodadvisor

🥘 THE Strapi demo application
MIT License
1.09k stars 446 forks source link

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

Closed Barokai closed 1 year ago

Barokai commented 2 years ago

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

quentin-js commented 2 years ago

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

Mcastres commented 2 years ago

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!