get authToken and set Authorization header in axios request interceptor

This commit is contained in:
dongfang committed 2025-02-18 04:56:26 +00:00
1 parent d3fa71f114
commit 1410c23c99
1 file changed
+4 -1
+4 -1
View File
@@ -28,9 +28,12 @@ class NetworkService {
(config) => { (config) => {
const currentLanguage = i18next.language || "en"; const currentLanguage = i18next.language || "en";
const { authToken } = store.getState().auth;
config.headers = { config.headers = {
...config.headers, Authorization: `Bearer ${authToken}`,
"Accept-Language": currentLanguage, "Accept-Language": currentLanguage,
...config.headers,
}; };
return config; return config;