@mongoosejs/studio
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -15,2 +15,8 @@ 'use strict'; | ||
} | ||
if (options?.setAuthorizationHeaderFrom) { | ||
config.plugins = config.plugins || []; | ||
config.plugins.push(new webpack.DefinePlugin({ | ||
config__setAuthorizationHeaderFrom: `'${options.setAuthorizationHeaderFrom}'` | ||
})); | ||
} | ||
const compiler = webpack(config); | ||
@@ -17,0 +23,0 @@ |
@@ -10,2 +10,12 @@ 'use strict'; | ||
window.apiClient = client; | ||
if (typeof config__setAuthorizationHeaderFrom === 'string' && config__setAuthorizationHeaderFrom) { | ||
client.interceptors.request.use(req => { | ||
const accessToken = window.localStorage.getItem(config__setAuthorizationHeaderFrom) || null; | ||
if (accessToken) { | ||
req.headers.authorization = accessToken; | ||
} | ||
return req; | ||
}); | ||
} | ||
@@ -12,0 +22,0 @@ if (config__isLambda) { |
{ | ||
"name": "@mongoosejs/studio", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "archetype": "0.13.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
171641
1491