mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
patch from @bshevchenko
This commit is contained in:
parent
f263b4d066
commit
3dc6c77e3c
2
gun.js
2
gun.js
@ -1941,7 +1941,7 @@
|
||||
return;
|
||||
}
|
||||
// add hook for AXE?
|
||||
if (Gun.AXE && opt && opt.super) { Gun.AXE.say(msg, mesh.say, this); return; }
|
||||
//if (Gun.AXE && opt && opt.super) { Gun.AXE.say(msg, mesh.say, this); return; } // rogowski
|
||||
mesh.say(msg);
|
||||
}
|
||||
|
||||
|
18
sea.js
18
sea.js
@ -37,13 +37,13 @@
|
||||
|
||||
;USE(function(module){
|
||||
var SEA = USE('./root');
|
||||
if(SEA.window){
|
||||
try{ if(SEA.window){
|
||||
if(location.protocol.indexOf('s') < 0
|
||||
&& location.host.indexOf('localhost') < 0
|
||||
&& location.protocol.indexOf('file:') < 0){
|
||||
location.protocol = 'https:'; // WebCrypto does NOT work without HTTPS!
|
||||
}
|
||||
}
|
||||
} }catch(e){}
|
||||
})(USE, './https');
|
||||
|
||||
;USE(function(module){
|
||||
@ -775,7 +775,7 @@
|
||||
}
|
||||
cat.ing = true;
|
||||
opt = opt || {};
|
||||
var pair = (alias.pub || alias.epub)? alias : (pass.pub || pass.epub)? pass : null;
|
||||
var pair = (alias && (alias.pub || alias.epub))? alias : (pass && (pass.pub || pass.epub))? pass : null;
|
||||
var act = {}, u;
|
||||
act.a = function(data){
|
||||
if(!data){ return act.b() }
|
||||
@ -827,10 +827,12 @@
|
||||
opt.change? act.z() : cb(at);
|
||||
if(SEA.window && ((gun.back('user')._).opt||opt).remember){
|
||||
// TODO: this needs to be modular.
|
||||
var sS = {}; try{sS = window.sessionStorage}catch(e){}
|
||||
try{var sS = {};
|
||||
sS = window.sessionStorage;
|
||||
sS.recall = true;
|
||||
sS.alias = alias;
|
||||
sS.tmp = pass;
|
||||
}catch(e){}
|
||||
}
|
||||
try{
|
||||
(root._).on('auth', at) // TODO: Deprecate this, emit on user instead! Update docs when you do.
|
||||
@ -892,10 +894,12 @@
|
||||
delete user._.sea;
|
||||
}
|
||||
if(SEA.window){
|
||||
var sS = {}; try{sS = window.sessionStorage}catch(e){};
|
||||
try{var sS = {};
|
||||
sS = window.sessionStorage;
|
||||
delete sS.alias;
|
||||
delete sS.tmp;
|
||||
delete sS.recall;
|
||||
}catch(e){};
|
||||
}
|
||||
return gun;
|
||||
}
|
||||
@ -921,7 +925,8 @@
|
||||
opt = opt || {};
|
||||
if(opt && opt.sessionStorage){
|
||||
if(SEA.window){
|
||||
var sS = {}; try{sS = window.sessionStorage}catch(e){}
|
||||
try{var sS = {};
|
||||
sS = window.sessionStorage;
|
||||
if(sS){
|
||||
(root._).opt.remember = true;
|
||||
((gun.back('user')._).opt||opt).remember = true;
|
||||
@ -929,6 +934,7 @@
|
||||
root.user().auth(sS.alias, sS.tmp, cb);
|
||||
}
|
||||
}
|
||||
}catch(e){}
|
||||
}
|
||||
return gun;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user