]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12193 Fix redirect issue on 403 errors
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Fri, 21 Jun 2019 14:21:44 +0000 (16:21 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 28 Jun 2019 06:45:53 +0000 (08:45 +0200)
server/sonar-web/src/main/js/app/components/ComponentContainer.tsx

index 9ef3f832d684f894a93ebc13dcdd1dd435c08c74..cf324a50259ce950c4a0106de22447c0139c0cee 100644 (file)
@@ -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 {