mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-26 23:43:46 +00:00
Clear cached userDetails when auth events occur (fixes #2588)
This commit is contained in:
@@ -18,8 +18,10 @@ iD.Connection = function() {
|
||||
nodeStr = 'node',
|
||||
wayStr = 'way',
|
||||
relationStr = 'relation',
|
||||
userDetails,
|
||||
off;
|
||||
|
||||
|
||||
connection.changesetURL = function(changesetId) {
|
||||
return url + '/changeset/' + changesetId;
|
||||
};
|
||||
@@ -283,8 +285,6 @@ iD.Connection = function() {
|
||||
});
|
||||
};
|
||||
|
||||
var userDetails;
|
||||
|
||||
connection.userDetails = function(callback) {
|
||||
if (userDetails) {
|
||||
callback(undefined, userDetails);
|
||||
@@ -411,6 +411,7 @@ iD.Connection = function() {
|
||||
};
|
||||
|
||||
connection.flush = function() {
|
||||
userDetails = undefined;
|
||||
_.forEach(inflight, abortRequest);
|
||||
loadedTiles = {};
|
||||
inflight = {};
|
||||
@@ -424,12 +425,14 @@ iD.Connection = function() {
|
||||
};
|
||||
|
||||
connection.logout = function() {
|
||||
userDetails = undefined;
|
||||
oauth.logout();
|
||||
event.auth();
|
||||
return connection;
|
||||
};
|
||||
|
||||
connection.authenticate = function(callback) {
|
||||
userDetails = undefined;
|
||||
function done(err, res) {
|
||||
event.auth();
|
||||
if (callback) callback(err, res);
|
||||
|
||||
Reference in New Issue
Block a user