9M6
9M6
Explore posts from servers
CDCloudflare Developers
Created by 9M6 on 5/25/2024 in #workers-help
Invalid credentials. even though I pass the Bearer
Hello, I'm facing an issue that when I do a fetch request (ofetch, native fetch, does not matter) and I am passing Authorization: headers, the response is:
(log) onResponse {
request: '/users/token',
options: {
baseURL: 'https://api.domain.com/v1',
headers: {},
method: 'POST',
body: '{"userId":"org_588efe165d1d6"}'
},
(log) onResponse {
request: '/users/token',
options: {
baseURL: 'https://api.domain.com/v1',
headers: {},
method: 'POST',
body: '{"userId":"org_588efe165d1d6"}'
},
Now, when I am checking the logs on the api that I am trying to call, it does not show any successful api request being made. Is there some caching rules/issues?
3 replies
CDCloudflare Developers
Created by 9M6 on 5/21/2024 in #pages-help
$fetch request to API with `Bearer` token not working, headers not included?
Hello, anyone knows why when I made a $fetch to an endpoint with a Bearer token from localhost it works. but from Cloudflare returns 401 ? Does Cloudflare removes any of the headers when sending the request? Its kind of driving me crazy, I've tried to debug this but no success. When using Digital Ocean apps the same request works no problem, it only happens in Cloudflare. I'm using nitro from unjs with ofetch.
1 replies