commonplace
Advanced tools
Comparing version 0.2.9 to 0.3.1
{ | ||
"name": "commonplace", | ||
"version": "0.2.9", | ||
"version": "0.3.1", | ||
"preferGlobal": true, | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -26,22 +26,27 @@ define('login', | ||
e.preventDefault(); | ||
user.clear_token(); | ||
z.body.removeClass('logged-in'); | ||
z.page.trigger('reload_chrome').trigger('before_logout'); | ||
if (capabilities.persona) { | ||
console.log('Triggering Persona logout'); | ||
navigator.id.logout(); | ||
} | ||
requests.del(urls.api.url('logout')).done(function() { | ||
// Moved here from the onlogout callback for now until | ||
// https://github.com/mozilla/browserid/issues/3229 | ||
// gets fixed. | ||
user.clear_token(); | ||
z.body.removeClass('logged-in'); | ||
z.page.trigger('reload_chrome').trigger('before_logout'); | ||
// Moved here from the onlogout callback for now until | ||
// https://github.com/mozilla/browserid/issues/3229 | ||
// gets fixed. | ||
if (!z.context.dont_reload_on_login) { | ||
require('views').reload().done(function(){ | ||
z.page.trigger('logged_out'); | ||
signOutNotification(); | ||
}); | ||
} else { | ||
console.log('Reload on logout aborted by current view'); | ||
} | ||
if (capabilities.persona) { | ||
console.log('Triggering Persona logout'); | ||
navigator.id.logout(); | ||
} | ||
if (!z.context.dont_reload_on_login) { | ||
require('views').reload().done(function(){ | ||
z.page.trigger('logged_out'); | ||
signOutNotification(); | ||
}); | ||
} else { | ||
console.log('Reload on logout aborted by current view'); | ||
} | ||
}).fail(function() { | ||
notification.notification({message: gettext('Error signing out')}); | ||
}); | ||
}); | ||
@@ -48,0 +53,0 @@ |
@@ -20,2 +20,10 @@ define('storage', ['settings'], function(settings) { | ||
// Expose storage version (which is prefixed to every key). | ||
// For instance, used in Zamboni login.js. | ||
try { | ||
ls.setItem('latestStorageVersion', settings.storage_version); | ||
} catch(e) { | ||
fakeStorage.latestStorageVersion = settings.storage_version; | ||
} | ||
return { | ||
@@ -22,0 +30,0 @@ clear: function() { |
@@ -19,6 +19,7 @@ define('user', | ||
if (save_to_ls) { | ||
// Try to initialize items from localStorage. | ||
token = storage.getItem('user'); | ||
log.unmention(token); | ||
settings = JSON.parse(storage.getItem('settings') || '{}'); | ||
permissions = JSON.parse(storage.getItem('permissions') || '{}'); | ||
var _stored = storage.getItem('user_apps'); | ||
@@ -28,5 +29,4 @@ if (_stored) { | ||
} | ||
} | ||
if (save_to_ls) { | ||
log.unmention(token); | ||
save_settings(); | ||
@@ -33,0 +33,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
875399
11825