diff --git a/src/user/login-complete.js b/src/user/login-complete.js
index 8397720..3bca1f7 100644
--- a/src/user/login-complete.js
+++ b/src/user/login-complete.js
@@ -63,9 +63,9 @@ class LoginComplete extends React.Component {
}
}
- componentDidUnmount() {
+ stopTimer() {
console.log("component unmounting");
- //clearInterval(this.timer);
+ clearInterval(this.timer);
}
startTimer() {
@@ -93,13 +93,15 @@ class LoginComplete extends React.Component {
if (this.state.currentUser && this.state.currentUser !== "") {
console.log("user:");
console.log(this.state.currentUser);
+ this.stopTimer();
return (
Authenticating.. {this.state.secondsToWait}
); - } else { // authenticating failed - //NotificationsFactory.LOAD_ERROR('Backend did not return user after external auth'); + else if (this.state.secondsToWait == 0) { + this.stopTimer(); return (Authenticating.. {this.state.secondsToWait}
); } } } diff --git a/src/user/login-store.js b/src/user/login-store.js index c553e17..c236639 100644 --- a/src/user/login-store.js +++ b/src/user/login-store.js @@ -58,6 +58,8 @@ class LoginStore extends ReduceStore { console.log(action); localStorage.setItem('token', action.token); localStorage.setItem('currentUser', JSON.stringify(action.currentUser)); + console.log(localStorage.getItem('token')); + console.log(localStorage.getItem("currentUser")); return Object.assign({}, state, { token: action.token, currentUser: action.currentUser});