mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01:00
patch logout behavior
This commit is contained in:
parent
28f875e90c
commit
efd329c44c
@ -23,7 +23,7 @@ class UserActions {
|
||||
});
|
||||
}
|
||||
logoutCurrentUser() {
|
||||
UserFetcher.logout()
|
||||
return UserFetcher.logout()
|
||||
.then(() => {
|
||||
this.actions.deleteCurrentUser();
|
||||
})
|
||||
|
@ -80,7 +80,6 @@ let Form = React.createClass({
|
||||
this.setState({edited: false, submitted: false});
|
||||
},
|
||||
handleError(err){
|
||||
console.log(err);
|
||||
if (err.json) {
|
||||
for (var input in err.json.errors){
|
||||
if (this.refs && this.refs[input] && this.refs[input].state) {
|
||||
|
@ -3,7 +3,6 @@
|
||||
import React from 'react';
|
||||
import Router from 'react-router';
|
||||
|
||||
let Link = Router.Link;
|
||||
import UserActions from '../actions/user_actions';
|
||||
import Alt from '../alt';
|
||||
|
||||
@ -15,11 +14,16 @@ let LogoutContainer = React.createClass({
|
||||
mixins: [Router.Navigation, Router.State],
|
||||
|
||||
componentDidMount() {
|
||||
UserActions.logoutCurrentUser();
|
||||
Alt.flush();
|
||||
// kill intercom (with fire)
|
||||
window.Intercom('shutdown');
|
||||
this.transitionTo(baseUrl);
|
||||
UserActions.logoutCurrentUser()
|
||||
.then(() => {
|
||||
Alt.flush();
|
||||
// kill intercom (with fire)
|
||||
window.Intercom('shutdown');
|
||||
this.transitionTo(baseUrl);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.logGlobal(err);
|
||||
});
|
||||
},
|
||||
|
||||
render() {
|
||||
|
Loading…
Reference in New Issue
Block a user