@goat-bravos/shared-lib-client 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,11 +69,11 @@ function isExcluded(url) {
|
|
|
69
69
|
*/
|
|
70
70
|
export const authInterceptor = (req, next) => {
|
|
71
71
|
// 1. Lấy access token từ localStorage
|
|
72
|
-
const token = StorageUtil.getAccessToken();
|
|
72
|
+
const token = StorageUtil.getAccessToken() || " ";
|
|
73
73
|
let authReq = req;
|
|
74
74
|
const isExcludedRequest = isExcluded(req.url);
|
|
75
75
|
// 2. Gắn Authorization header nếu request không nằm trong nhóm loại trừ
|
|
76
|
-
if (
|
|
76
|
+
if (!isExcludedRequest) {
|
|
77
77
|
authReq = req.clone({
|
|
78
78
|
setHeaders: {
|
|
79
79
|
Authorization: `Bearer ${token}`,
|