prismicio / prismic-ts-codegen

A Prismic model-to-TypeScript-type generator.
Apache License 2.0
18 stars 6 forks source link

ForbiddenError: User is not authorized to access this resource with an explicit deny #36

Closed HeinDiez closed 2 years ago

HeinDiez commented 2 years ago

Versions

Reproduction

Additional Details

Steps to reproduce

follow steps at loading-remote-models-with-the-custom-types-api

What is expected?

generate TypeScript types based on your Custom Type into output: "./types.generated.ts",

What is actually happening?

url: 'https://customtypes.prismic.io/slices', response: { message: 'User is not authorized to access this resource with an explicit deny' } Screenshot 2022-11-16 152838

HeinDiez commented 2 years ago

I was able to fix it. You just need to remove the "Bearer" tag.

const config: Config = { output: "./types.generated.ts", repositoryName: repositoryName, customTypesAPIToken: accessTypes, models: { files: ['./customtypes/**/index.json', './slices/**/model.json'], fetchFromRepository: true, }, };

The documentation in the Custom Type API tab was a bit confusing and I ended up adding the bearer tag.