Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Authentication to collectionTypes/singleTypes endpoints fail after successful request to /auth/local #215

Closed
kminhc opened this issue May 20, 2021 · 0 comments · Fixed by #216
Assignees

Comments

@kminhc
Copy link
Contributor

kminhc commented May 20, 2021

The JWT-Token request seems to be successful according to build-log

...
success Authenticate Strapi User - 0.344s
...

and server-log

[2021-05-20T23:14:20.521Z] debug POST /auth/local (172 ms) 200

But the actual requests to acquire the collection data seems to be failing with an HTTP 403 error

[2021-05-20T23:30:31.364Z] debug GET /contact?_limit=1000 (36 ms) 403
[2021-05-20T23:30:31.368Z] debug GET /users?_limit=1000 (29 ms) 403
[2021-05-20T23:30:31.369Z] debug GET /article-feeds?_limit=1000 (34 ms) 403
[2021-05-20T23:30:31.372Z] debug GET /pages?_limit=1000 (28 ms) 403
[2021-05-20T23:30:31.374Z] debug GET /articles?_limit=1000 (16 ms) 403
[2021-05-20T23:30:31.374Z] debug GET /site-config?_limit=1000 (23 ms) 403

This only occurs with the new 1.0.0 release, the 1.0.0-alpha.1 worked and still works fine.

The only thing, that changed is the usage of collectionTypes instead of contentTypes in the gatsby-config.js
according to the README.md

Context (Environment)

strapi 3.6.2 in both development and production mode with credentials passed in as environment variable or
inline ( tried both )

Potential Fix

Found the method where the token is set in the request Header. It seems to be set with an additional header in the Authorization key.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants