]> source.dussan.org Git - sonarqube.git/commitdiff
redirect to the login page when accessing private project anonymously
authorStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 2 Oct 2018 13:57:10 +0000 (15:57 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 3 Oct 2018 07:28:22 +0000 (09:28 +0200)
server/sonar-web/src/main/js/app/components/ComponentContainer.tsx

index 00bc81854f5905cd561b7e994ceac0a1ea3e7050..346a52d154d6e02e3a5cbf8e5c4d7f5d9ad71502 100644 (file)
@@ -104,9 +104,9 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     const { branch, id: key, pullRequest } = props.location.query;
     this.setState({ loading: true });
 
-    const onError = (error: any) => {
+    const onError = (response?: Response) => {
       if (this.mounted) {
-        if (error.response && error.response.status === 403) {
+        if (response && response.status === 403) {
           handleRequiredAuthorization();
         } else {
           this.setState({ loading: false });