Skip to content

Commit a3f2e5b

Browse files
author
Jicheng Lu
committed
add auth header
1 parent b28edfd commit a3f2e5b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/lib/helpers/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const retryQueue = {
6767
if (!item?.config) {
6868
continue;
6969
}
70-
70+
7171
const { config } = item;
7272
// @ts-ignore
7373
config.headers = config.headers || {};

src/lib/services/auth-service.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export async function getToken(email, password, onSucceed, onError) {
4848
export async function renewToken(token, onSucceed = null, onError = null) {
4949
await fetch(endpoints.renewTokenUrl, {
5050
method: 'POST',
51-
headers: { "Content-Type": "application/json" },
51+
headers: {
52+
"Content-Type": "application/json",
53+
"Authorization": `Bearer ${token}`
54+
},
5255
body: JSON.stringify({ refresh_token: token, access_token: token }),
5356
}).then(response => {
5457
if (response.ok) {

0 commit comments

Comments
 (0)