Hi guys Hope you could help me.
I already have a running DigitalOcean Strapi Backend and it work as usual. But when I try to setup the sendgrid api key, what I did is just copy my local env and drop it through ftp. I never though that it has already env file on the server it is just hidden and somehow it may overriden the default one. This is my first time deploying app to a server so I never have any much knowledge about it. Upon checking the Documentation I manage to check the strapi logs and it shows error like this :
0|strapi-d | [2021-07-08T13:09:24.573Z] error Error: secretOrPrivateKey must have a value
0|strapi-d | at Object.module.exports [as sign] (/srv/strapi/strapi-development/node_modules/jsonwebtoken/sign.js:107:20)
0|strapi-d | at Object.createJwtToken (/srv/strapi/strapi-development/node_modules/strapi-admin/services/token.js:33:14)
0|strapi-d | at /srv/strapi/strapi-development/node_modules/strapi-admin/controllers/authentication.js:43:46
0|strapi-d | at dispatch (/srv/strapi/strapi-development/node_modules/koa-compose/index.js:42:32)
0|strapi-d | at /srv/strapi/strapi-development/node_modules/strapi-admin/controllers/authentication.js:35:16
0|strapi-d | at callback (/srv/strapi/strapi-development/node_modules/koa-passport/lib/framework/koa.js:93:25)
0|strapi-d | at Strategy.strategy.success (/srv/strapi/strapi-development/node_modules/passport/lib/middleware/authenticate.js:219:18)
0|strapi-d | at verified (/srv/strapi/strapi-development/node_modules/passport-local/lib/strategy.js:83:10)
0|strapi-d | at /srv/strapi/strapi-development/node_modules/strapi-admin/services/passport/local-strategy.js:15:43
So how could this be solve? How could I get a proper env file that I could add my sendgrid api key with my jwt token working? Or I may have something missing here. I would greatly appreciate your help here.
My server.js :
module.exports = ({ env }) => ({
host: env(‘HOST’, ‘0.0.0.0’),
port: env.int(‘PORT’, 1337),
url: env(‘NGINX_URL’, ‘’),
admin: {
auth: {
secret: env(‘ADMIN_JWT_SECRET’),
},
},
});