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:
@@ -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
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user