Skip to content

Add Authorization header with Bearer token from jwtToken cookie - #11

Open
omebarki wants to merge 1 commit into
Prototypr:mainfrom
omebarki:main
Open

Add Authorization header with Bearer token from jwtToken cookie#11
omebarki wants to merge 1 commit into
Prototypr:mainfrom
omebarki:main

Conversation

@omebarki

@omebarki omebarki commented Apr 5, 2026

Copy link
Copy Markdown

Strapi's built-in useFetchClient reads the JWT from localStorage/sessionStorage,
but the token is stored in a cookie, resulting in empty Authorization headers
and 401 errors. Added a utility that reads the jwtToken cookie and passes it
as a custom Authorization header on all plugin API requests.

  Strapi's built-in useFetchClient reads the JWT from localStorage/sessionStorage,
  but the token is stored in a cookie, resulting in empty Authorization headers
  and 401 errors. Added a utility that reads the jwtToken cookie and passes it
  as a custom Authorization header on all plugin API requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant