Skip to content

Commit

Permalink
Change Authorization header type for API requests from "token" to "…
Browse files Browse the repository at this point in the history
…Bearer" (#7242)

The authorization type "Bearer" is more widely recognized than "token". E.g. Gitlab requires that you use "Bearer".
This should fix #7172 where apparently login with Github was broken by this line: #7172 (comment)
See also: #5844 (comment)
  • Loading branch information
floscher authored and martinjagodic committed Aug 5, 2024
1 parent 70b038b commit 29f7f48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/decap-cms-lib-util/src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function constructRequestHeaders(headerConfig: HeaderConfig) {
const { token, headers } = headerConfig;
const baseHeaders: HeaderObj = { 'Content-Type': 'application/json; charset=utf-8', ...headers };
if (token) {
baseHeaders['Authorization'] = `token ${token}`;
baseHeaders['Authorization'] = `Bearer ${token}`;
}
return Promise.resolve(baseHeaders);
}
Expand Down

0 comments on commit 29f7f48

Please sign in to comment.