Skip to content

Commit 029e11d

Browse files
authored
Change Authorization header type for API requests from "token" to "Bearer" (decaporg#7242)
The authorization type "Bearer" is more widely recognized than "token". E.g. Gitlab requires that you use "Bearer". This should fix decaporg#7172 where apparently login with Github was broken by this line: decaporg#7172 (comment) See also: decaporg#5844 (comment)
1 parent a99c7d9 commit 029e11d

File tree

1 file changed

+1
-1
lines changed
  • packages/decap-cms-lib-util/src

1 file changed

+1
-1
lines changed

packages/decap-cms-lib-util/src/API.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ async function constructRequestHeaders(headerConfig: HeaderConfig) {
182182
const { token, headers } = headerConfig;
183183
const baseHeaders: HeaderObj = { 'Content-Type': 'application/json; charset=utf-8', ...headers };
184184
if (token) {
185-
baseHeaders['Authorization'] = `token ${token}`;
185+
baseHeaders['Authorization'] = `Bearer ${token}`;
186186
}
187187
return Promise.resolve(baseHeaders);
188188
}

0 commit comments

Comments
 (0)