Redirect to /educators/classes if a confirmed teacher

Fixes #757. Note: Because we are getting this info from the session, the redirect may not happen until the page is rendered first in cases where the connection is slow, or the db is slow.
This commit is contained in:
Matthew Taylor 2016-07-26 15:24:51 -04:00
parent 1c7dc73ed7
commit 60a62bb374

View file

@ -762,9 +762,16 @@ module.exports = {
getDefaultProps: function () {
return {
email: null,
invited: false
invited: false,
confirmed: false,
educator: true
};
},
componentWillReceiveProps: function (nextProps) {
if (nextProps.educator && nextProps.confirmed) {
window.location.href = '/educators/classes/';
}
},
render: function () {
return (
<Slide className="registration-step last-step">