File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
apps/tuk-web/src/shared/lib/api/rest Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,25 @@ import { getBridgeSender } from '@/shared/lib/app-bridge/bridgeSender';
66export { RestAPI } from './rest' ;
77export 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+
920const defaultJsonInstance = ( baseURL : string ) =>
1021 new RestAPIInstance ( baseURL , {
1122 withCredentials : false ,
1223 authHeader : ( ) => {
1324 if ( typeof window === 'undefined' ) return null ;
14- const token = sessionStorage . getItem ( 'accessToken' ) ;
15- return token ? { Authorization : `Bearer ${ token } ` } : null ;
25+ const token =
26+ 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzNiIsIm1lbWJlcklkIjoiMzYiLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJpYXQiOjE3NTUwOTM4NDMsImV4cCI6MTc1NzY4NTg0M30.UsHc49wjfip_NsMEK3Iwx8foswcGeECMuIZZjn57yBk' ;
27+ return token ? { Authorization : `Bearer ${ token . trim ( ) } ` } : null ;
1628 } ,
1729 bridgeSend : msg => getBridgeSender ( ) ?.( msg ) ,
1830 } ) ;
You can’t perform that action at this time.
0 commit comments