I am trying to retrieve the user token from the cookies, but they are HTTP-only and can not be accessed. Is there a way to extract the user token from the cookie and include it in the headers of external API requests? My back-end is written in Go and uses an authentication middleware to protect the routes. The token is required in the headers for authentication.
TL;DR
Developers are struggling to retrieve the user access token from HTTP-only cookies for including it in headers of API requests. Their back-end, written in Go, uses authentication middleware.
Solution: One way to pass the token could be to send it as a query parameter in the URL instead of as a header. Another option could be to have the back-end send the token to the front-end via an endpoint specifically for retrieving the token.