]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9579 No redirect when browsing my new issues without authentication
authorStas Vilchik <stas.vilchik@sonarsource.com>
Thu, 12 Oct 2017 12:46:07 +0000 (14:46 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 16 Oct 2017 09:08:02 +0000 (11:08 +0200)
server/sonar-web/src/main/js/apps/issues/components/App.js
server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx

index d0befcca5afaffcc40212043bad406a9bebd6588..cf11407a64bcac1227cf1228e043d37b855ff2a3 100644 (file)
@@ -53,6 +53,7 @@ import {
   Component,
   CurrentUser
 } from '../utils'; */
+import handleRequiredAuthentication from '../../../app/utils/handleRequiredAuthentication';
 import ListFooter from '../../../components/controls/ListFooter';
 import EmptySearch from '../../../components/common/EmptySearch';
 import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
@@ -139,6 +140,11 @@ export default class App extends React.PureComponent {
   componentDidMount() {
     this.mounted = true;
 
+    if (this.state.myIssues && !this.props.currentUser.isLoggedIn) {
+      handleRequiredAuthentication();
+      return;
+    }
+
     const footer = document.getElementById('footer');
     if (footer) {
       footer.classList.add('page-footer-with-sidebar');
index deb67d0892ec95d05e7b42fdd821d9086248ae06..4181d618a10b09643afeaa500709a47c3fda4d23 100644 (file)
@@ -24,6 +24,7 @@ import PageHeader from './PageHeader';
 import ProjectsList from './ProjectsList';
 import PageSidebar from './PageSidebar';
 import Visualizations from '../visualizations/Visualizations';
+import handleRequiredAuthentication from '../../../app/utils/handleRequiredAuthentication';
 import ListFooter from '../../../components/controls/ListFooter';
 import { translate } from '../../../helpers/l10n';
 import * as storage from '../../../helpers/storage';
@@ -60,6 +61,10 @@ export default class AllProjects extends React.PureComponent<Props, State> {
 
   componentDidMount() {
     this.mounted = true;
+    if (this.props.isFavorite && !this.context.currentUser.isLoggedIn) {
+      handleRequiredAuthentication();
+      return;
+    }
     this.handleQueryChange(true);
     const footer = document.getElementById('footer');
     footer && footer.classList.add('page-footer-with-sidebar');