revert(tandoor): change auth header back to Bearer

User's Tandoor instance uses Bearer token authentication (likely JWT)
rather than Django REST Framework's Token authentication.

Reverts authentication from 'Token' back to 'Bearer' to fix 403 error:
'Authentication credentials were not provided.'
This commit is contained in:
Giancarmine Salucci
2025-12-21 05:08:41 +01:00
parent d1a57dd595
commit 856c5c26f4

View File

@@ -108,7 +108,7 @@ async function fetchFromTandoor<T>(
const headers = new Headers({
'Content-Type': 'application/json',
'Accept': 'application/json',
Authorization: `Token ${tandoorConfig.token}`
Authorization: `Bearer ${tandoorConfig.token}`
});
// Merge any additional headers from options
@@ -407,7 +407,7 @@ export async function uploadRecipeImage(
`${tandoorConfig.serverUrl}/api/recipe/${recipeId}/image/`,
{
method: 'PUT',
headers: { 'Authorization': `Token ${token}` },
headers: { 'Authorization': `Bearer ${token}` },
body: formData
}
);
@@ -445,7 +445,7 @@ export async function uploadRecipeImage(
`${tandoorConfig.serverUrl}/api/recipe/${recipeId}/image/`,
{
method: 'PUT',
headers: { 'Authorization': `Token ${token}` },
headers: { 'Authorization': `Bearer ${token}` },
body: formData
}
);
@@ -482,7 +482,7 @@ export async function uploadRecipeImage(
`${tandoorConfig.serverUrl}/api/recipe/${recipeId}/image/`,
{
method: 'PUT',
headers: { 'Authorization': `Token ${token}` },
headers: { 'Authorization': `Bearer ${token}` },
body: formData
}
);