Skip to content

Commit ca370e2

Browse files
committed
fix: token 수정
1 parent 3c7b6a7 commit ca370e2

File tree

1 file changed

+14
-14
lines changed
  • apps/tuk-web/src/shared/lib/api/rest

1 file changed

+14
-14
lines changed

apps/tuk-web/src/shared/lib/api/rest/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ import { getBridgeSender } from '@/shared/lib/app-bridge/bridgeSender';
66
export { RestAPI } from './rest';
77
export type { RestAPIConfig, RestAPIProtocol } from './types';
88

9-
// const defaultJsonInstance = (baseURL: string) =>
10-
// new RestAPIInstance(baseURL, {
11-
// withCredentials: false,
12-
// authHeader: () => {
13-
// if (typeof window === 'undefined') return null;
14-
// const token = sessionStorage.getItem('accessToken');
15-
// return token ? { Authorization: `Bearer ${token}` } : null;
16-
// },
17-
// bridgeSend: msg => getBridgeSender()?.(msg),
18-
// });
19-
209
const defaultJsonInstance = (baseURL: string) =>
2110
new RestAPIInstance(baseURL, {
2211
withCredentials: false,
2312
authHeader: () => {
2413
if (typeof window === 'undefined') return null;
25-
const token =
26-
'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMiIsIm1lbWJlcklkIjoiMzIiLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJpYXQiOjE3NTUwMDM4NTQsImV4cCI6MTc1NzU5NTg1NH0.sXHpNsim8-nIUdCjnAcOIZGsg2gUo8rnpkBmN-z5dKU';
27-
return token ? { Authorization: `Bearer ${token.trim()}` } : null;
14+
const token = sessionStorage.getItem('accessToken');
15+
return token ? { Authorization: `Bearer ${token}` } : null;
2816
},
17+
bridgeSend: msg => getBridgeSender()?.(msg),
2918
});
3019

20+
// const defaultJsonInstance = (baseURL: string) =>
21+
// new RestAPIInstance(baseURL, {
22+
// withCredentials: false,
23+
// authHeader: () => {
24+
// if (typeof window === 'undefined') return null;
25+
// const token =
26+
// 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMiIsIm1lbWJlcklkIjoiMzIiLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJpYXQiOjE3NTUwMDM4NTQsImV4cCI6MTc1NzU5NTg1NH0.sXHpNsim8-nIUdCjnAcOIZGsg2gUo8rnpkBmN-z5dKU';
27+
// return token ? { Authorization: `Bearer ${token.trim()}` } : null;
28+
// },
29+
// });
30+
3131
const formInstance = (baseURL: string) =>
3232
new RestAPIInstance(baseURL, {
3333
withCredentials: false,

0 commit comments

Comments
 (0)