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?
1 Reply
9M6
9M64mo ago
response: { _data: { code: 401, message: 'Invalid credentials.' } }
response: { _data: { code: 401, message: 'Invalid credentials.' } }
(log) onRequest {
request: '/users/token',
options: {
baseURL: 'https://api.domain.com/v1',
headers: {
Authorization: 'Bearer api-key'
},
method: 'POST',
body: { userId: 'org_588efe165d1d6' }
}
(log) onRequest {
request: '/users/token',
options: {
baseURL: 'https://api.domain.com/v1',
headers: {
Authorization: 'Bearer api-key'
},
method: 'POST',
body: { userId: 'org_588efe165d1d6' }
}
Want results from more Discord servers?
Add your server