Browse Source

Store login information in mode dependent key.

pull/28/head
Simon Eisenmann 12 years ago
parent
commit
eced7b0ae1
  1. 8
      static/js/services/mediastream.js

8
static/js/services/mediastream.js

@ -124,7 +124,7 @@ define([
error(function(data, status) { error(function(data, status) {
if (error_cb) { if (error_cb) {
error_cb(data, status) error_cb(data, status)
} }
}); });
} }
}, },
@ -151,7 +151,7 @@ define([
error(function(data, status) { error(function(data, status) {
if (error_cb) { if (error_cb) {
error_cb(data, status) error_cb(data, status)
} }
}); });
}, },
store: function(data) { store: function(data) {
@ -159,12 +159,12 @@ define([
var store = _.clone(data); var store = _.clone(data);
store.v = 42; // No idea what number - so use 42. store.v = 42; // No idea what number - so use 42.
var login = sjcl.encrypt(secureKey, JSON.stringify(store)); var login = sjcl.encrypt(secureKey, JSON.stringify(store));
localStorage.setItem("mediastream-login", login); localStorage.setItem("mediastream-login-"+context.Cfg.UsersMode, login);
return login; return login;
}, },
load: function() { load: function() {
// Check if we have something in store. // Check if we have something in store.
var login = localStorage.getItem("mediastream-login"); var login = localStorage.getItem("mediastream-login-"+context.Cfg.UsersMode);
if (login) { if (login) {
try { try {
login = sjcl.decrypt(secureKey, login); login = sjcl.decrypt(secureKey, login);

Loading…
Cancel
Save