I haven't yet had a chance to test this on the other backend/frontend starters, so maybe this should be labelled as a WIP.
The gatsby-blog starter requires an API token, which is not set automatically, creating a bumpy first start-up. Also, I think that Authenticated permissions were missing within bootstrap to get it working.
This change generalizes the setPublicPermissions method to setInitPermissions where role can be passed along with the permissions object. A new method is added setInitFrontendAPIToken, which creates a full-access token type and writes the resulting access key to backend/env.development.
Caveats:
untested on the Nextjs versions, although I'm sure those will need similar things.
this monorepo reuses bootstrap.js in multiple templates where an initial API token would be undesirable, and where backend/env.development does not exist, such as the standard strapi-blog template. If I had a better idea of where/how the starting .env file was generated from, one solution would be to add a DEMO_IS_STARTER variable such that only multi-app starters make this change.
I haven't yet had a chance to test this on the other backend/frontend starters, so maybe this should be labelled as a WIP.
The
gatsby-blog
starter requires an API token, which is not set automatically, creating a bumpy first start-up. Also, I think that Authenticated permissions were missing within bootstrap to get it working.This change generalizes the
setPublicPermissions
method tosetInitPermissions
where role can be passed along with the permissions object. A new method is addedsetInitFrontendAPIToken
, which creates a full-access token type and writes the resulting access key tobackend/env.development
.Caveats:
bootstrap.js
in multiple templates where an initial API token would be undesirable, and wherebackend/env.development
does not exist, such as the standardstrapi-blog
template. If I had a better idea of where/how the starting.env
file was generated from, one solution would be to add aDEMO_IS_STARTER
variable such that only multi-app starters make this change.Resolves https://github.com/strapi/starters-and-templates/issues/38 I believe