diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-27 16:31:23 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-12-28 09:07:09 +0100 |
commit | a83bf33c9032a27173a7d8c62fdaf39e7aa0a278 (patch) | |
tree | bb30fec73fb83d33c03f1f02ce81b33313aaec01 /server/sonar-web | |
parent | 546e2fbf1289ce789e4f0b06f1a885411e898f85 (diff) | |
download | sonarqube-a83bf33c9032a27173a7d8c62fdaf39e7aa0a278.tar.gz sonarqube-a83bf33c9032a27173a7d8c62fdaf39e7aa0a278.zip |
require authentication when open "My Account" space
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/account/components/Account.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/account/components/Account.js b/server/sonar-web/src/main/js/apps/account/components/Account.js index 633a6da2275..ec2f895d076 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Account.js +++ b/server/sonar-web/src/main/js/apps/account/components/Account.js @@ -22,12 +22,23 @@ import { connect } from 'react-redux'; import Nav from './Nav'; import UserCard from './UserCard'; import { getCurrentUser } from '../../../store/rootReducer'; +import handleRequiredAuthentication from '../../../app/utils/handleRequiredAuthentication'; import '../account.css'; class Account extends React.Component { + componentDidMount () { + if (!this.props.currentUser.isLoggedIn) { + handleRequiredAuthentication(); + } + } + render () { const { currentUser, children } = this.props; + if (!currentUser.isLoggedIn) { + return null; + } + return ( <div id="account-page"> <header className="account-header"> |