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() {
|
logoutCurrentUser() {
|
||||||
UserFetcher.logout()
|
return UserFetcher.logout()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.actions.deleteCurrentUser();
|
this.actions.deleteCurrentUser();
|
||||||
})
|
})
|
||||||
|
@ -80,7 +80,6 @@ let Form = React.createClass({
|
|||||||
this.setState({edited: false, submitted: false});
|
this.setState({edited: false, submitted: false});
|
||||||
},
|
},
|
||||||
handleError(err){
|
handleError(err){
|
||||||
console.log(err);
|
|
||||||
if (err.json) {
|
if (err.json) {
|
||||||
for (var input in err.json.errors){
|
for (var input in err.json.errors){
|
||||||
if (this.refs && this.refs[input] && this.refs[input].state) {
|
if (this.refs && this.refs[input] && this.refs[input].state) {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Router from 'react-router';
|
import Router from 'react-router';
|
||||||
|
|
||||||
let Link = Router.Link;
|
|
||||||
import UserActions from '../actions/user_actions';
|
import UserActions from '../actions/user_actions';
|
||||||
import Alt from '../alt';
|
import Alt from '../alt';
|
||||||
|
|
||||||
@ -15,11 +14,16 @@ let LogoutContainer = React.createClass({
|
|||||||
mixins: [Router.Navigation, Router.State],
|
mixins: [Router.Navigation, Router.State],
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserActions.logoutCurrentUser();
|
UserActions.logoutCurrentUser()
|
||||||
Alt.flush();
|
.then(() => {
|
||||||
// kill intercom (with fire)
|
Alt.flush();
|
||||||
window.Intercom('shutdown');
|
// kill intercom (with fire)
|
||||||
this.transitionTo(baseUrl);
|
window.Intercom('shutdown');
|
||||||
|
this.transitionTo(baseUrl);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.logGlobal(err);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
Loading…
Reference in New Issue
Block a user