webgme-user-management-page
Advanced tools
Comparing version
{ | ||
"name": "webgme-user-management-page", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "User management page for webgme", | ||
@@ -84,5 +84,5 @@ "main": "./src/server/usermanagement.js", | ||
"url-loader": "^0.5.7", | ||
"webgme": "webgme/webgme", | ||
"webgme": "^2.24.0", | ||
"webpack": "^1.13.0" | ||
} | ||
} |
@@ -26,4 +26,5 @@ [](https://travis-ci.org/webgme/user-management-page) | ||
2. Install dependencies `npm install` | ||
3. Set environment variable for webpack: `set NODE_ENV=development` linux: `NODE_ENV=development` | ||
3. Run webpack `npm run webpack` | ||
4. Start (webgme) server `npm start` | ||
4. Start (webgme) server `npm start` (`NODE_ENV` should not be set) | ||
5. From a browser visit `http://localhost:8888/usermanagement/` | ||
@@ -30,0 +31,0 @@ |
@@ -34,3 +34,3 @@ /** | ||
<span className="pull-right hidden-xs" style={STYLE.footerRight}> | ||
<a href="https://github.com/webgme/user-management-page/releases" target="_blank">v0.3.4</a> | ||
<a href="https://github.com/webgme/user-management-page/releases" target="_blank">v0.3.6</a> | ||
</span> | ||
@@ -37,0 +37,0 @@ |
@@ -1,5 +0,6 @@ | ||
/* global window*/ | ||
/* global window, document*/ | ||
/** | ||
* User menu container | ||
* @author patrickkerrypei / https://github.com/patrickkerrypei | ||
* @author pmeijer / https://github.com/pmeijer | ||
*/ | ||
@@ -11,2 +12,3 @@ | ||
// Self-defined | ||
import BaseClient from '../../../../client/rest_client/baseClient'; | ||
import { fetchUserIfNeeded } from '../../../actions/user'; | ||
@@ -22,2 +24,6 @@ import { userLogout } from '../../../actions/general'; | ||
this.onSignOutBtnClick = this.onSignOutBtnClick.bind(this); | ||
this.restClient = new BaseClient(''); | ||
this.state = { | ||
gmeConfig: null | ||
}; | ||
} | ||
@@ -28,2 +34,11 @@ | ||
dispatch(fetchUserIfNeeded()); | ||
this.restClient.get(['/gmeConfig.json']) | ||
.then((gmeConfig) => { | ||
this.setState({ | ||
gmeConfig | ||
}); | ||
}) | ||
.catch((err) => { | ||
console.error(err); | ||
}); | ||
} | ||
@@ -33,4 +48,5 @@ | ||
const { dispatch } = this.props; | ||
const { gmeConfig } = this.state; | ||
dispatch(userLogout()); | ||
//dispatch(userLogout()); | ||
@@ -50,5 +66,8 @@ // The redirect target should be the _top so we need to add a temporary anchor.. | ||
document.body.appendChild(tempAnchor); | ||
// Note that path=/ is needed since the cookie is stored at root. | ||
window.document.cookie = gmeConfig.authentication.jwt.cookieId + | ||
'=;path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'; | ||
window.parent.postMessage('logout', '*'); | ||
tempAnchor.click(); | ||
window.parent.postMessage('logout', '*'); | ||
} | ||
@@ -55,0 +74,0 @@ |
Sorry, the diff of this file is too big to display
3703835
0.03%16792
0.13%53
1.92%