-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
26471 added App-Name to request headers #734
Conversation
- updated app name - added app name to Vite config - simplified Vite config - added App Name to Axios requests
|
@@ -11,15 +11,14 @@ const appName = JSON.parse(packageJson).appName | |||
const appVersion = JSON.parse(packageJson).version | |||
const sbcName = JSON.parse(packageJson).sbcName | |||
const sbcVersion = JSON.parse(packageJson).dependencies['sbc-common-components'] | |||
const aboutApp = (appName && appVersion) ? `${appName} v${appVersion}` : 'Unknown APP' | |||
const aboutSbc = (sbcName && sbcVersion) ? `${sbcName} v${sbcVersion}` : 'Unknown SBC' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can't parse the properties from the package.json file then we have bigger problems, so I simplified this.
@@ -11,6 +11,7 @@ instance.interceptors.request.use( | |||
|
|||
const kcToken = sessionStorage.getItem(SessionStorageKeys.KeyCloakToken) | |||
request.headers.common['Authorization'] = `Bearer ${kcToken}` | |||
request.headers.common['App-Name'] = import.meta.env.APP_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue #: bcgov/entity#26471
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the business-filings-ui license (Apache 2.0).