From 6b32b6acfc429c66d837b4176b97727340c5bdba Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Fri, 21 Jun 2019 16:21:44 +0200 Subject: [PATCH] SONAR-12193 Fix redirect issue on 403 errors --- .../src/main/js/app/components/ComponentContainer.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 { 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 { -- 2.39.5