summaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2019-06-21 16:21:44 +0200
committersonartech <sonartech@sonarsource.com>2019-06-28 08:45:53 +0200
commit6b32b6acfc429c66d837b4176b97727340c5bdba (patch)
treef09bb5ac3fe0f89e9e4e3e5944cb4e2752c7873e /server/sonar-web
parent2c42bcd7e4a998c9ee8c795b9945cc02da58b21c (diff)
downloadsonarqube-6b32b6acfc429c66d837b4176b97727340c5bdba.tar.gz
sonarqube-6b32b6acfc429c66d837b4176b97727340c5bdba.zip
SONAR-12193 Fix redirect issue on 403 errors
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/app/components/ComponentContainer.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
index 9ef3f832d68..cf324a50259 100644
--- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
+++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
@@ -100,8 +100,16 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
const { branch, id: key, pullRequest } = this.props.location.query;
this.setState({ loading: true });
- const onError = (response?: Response) => {
+ const onError = (param?: any) => {
if (this.mounted) {
+ let response: Response;
+
+ if (param && param.response) {
+ response = param.response;
+ } else {
+ response = param;
+ }
+
if (response && response.status === 403) {
this.props.requireAuthorization(this.props.router);
} else {