mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
Merge pull request #321 from mewtaylor/issue/scratchr2-3245-logout-post
Change logout to do a POST request
This commit is contained in:
commit
5e055fb6ea
1 changed files with 7 additions and 9 deletions
|
@ -4,7 +4,6 @@ var ReactIntl = require('react-intl');
|
|||
var defineMessages = ReactIntl.defineMessages;
|
||||
var FormattedMessage = ReactIntl.FormattedMessage;
|
||||
var injectIntl = ReactIntl.injectIntl;
|
||||
var xhr = require('xhr');
|
||||
|
||||
var Api = require('../../mixins/api.jsx');
|
||||
var Avatar = require('../avatar/avatar.jsx');
|
||||
|
@ -151,16 +150,15 @@ var Navigation = React.createClass({
|
|||
},
|
||||
handleLogOut: function (e) {
|
||||
e.preventDefault();
|
||||
xhr({
|
||||
this.api({
|
||||
host: '',
|
||||
uri: '/accounts/logout/'
|
||||
method: 'post',
|
||||
uri: '/accounts/logout/',
|
||||
useCsrf: true
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
log.error(err);
|
||||
} else {
|
||||
this.closeLogin();
|
||||
window.refreshSession();
|
||||
}
|
||||
if (err) log.error(err);
|
||||
this.closeLogin();
|
||||
window.refreshSession();
|
||||
}.bind(this));
|
||||
},
|
||||
handleAccountNavClick: function (e) {
|
||||
|
|
Loading…
Reference in a new issue