Update floDapps.js
- myFloID, myPubKey, myPrivKey will now return undefined when user not logged in
This commit is contained in:
parent
91e6b82387
commit
45878e6ebe
50
floDapps.js
50
floDapps.js
@ -1,16 +1,26 @@
|
|||||||
(function(EXPORTS) { //floDapps v2.3.2a
|
(function(EXPORTS) { //floDapps v2.3.2b
|
||||||
/* General functions for FLO Dapps*/
|
/* General functions for FLO Dapps*/
|
||||||
'use strict';
|
'use strict';
|
||||||
const floDapps = EXPORTS;
|
const floDapps = EXPORTS;
|
||||||
|
|
||||||
const DEFAULT = {
|
const DEFAULT = {
|
||||||
get root() {
|
root: "floDapps",
|
||||||
return "floDapps"
|
|
||||||
},
|
|
||||||
application: floGlobals.application,
|
application: floGlobals.application,
|
||||||
adminID: floGlobals.adminID
|
adminID: floGlobals.adminID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Object.defineProperties(floDapps, {
|
||||||
|
application: {
|
||||||
|
get: () => DEFAULT.application
|
||||||
|
},
|
||||||
|
adminID: {
|
||||||
|
get: () => DEFAULT.adminID
|
||||||
|
},
|
||||||
|
root: {
|
||||||
|
get: () => DEFAULT.root
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var user_priv_raw, aes_key, user_priv_wrap; //private variable inside capsule
|
var user_priv_raw, aes_key, user_priv_wrap; //private variable inside capsule
|
||||||
const raw_user = {
|
const raw_user = {
|
||||||
get private() {
|
get private() {
|
||||||
@ -73,16 +83,40 @@
|
|||||||
|
|
||||||
Object.defineProperties(window, {
|
Object.defineProperties(window, {
|
||||||
myFloID: {
|
myFloID: {
|
||||||
get: () => user.id
|
get: () => {
|
||||||
|
try {
|
||||||
|
return user.id;
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
myUserID: {
|
myUserID: {
|
||||||
get: () => user.id
|
get: () => {
|
||||||
|
try {
|
||||||
|
return user.id;
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
myPubKey: {
|
myPubKey: {
|
||||||
get: () => user.public
|
get: () => {
|
||||||
|
try {
|
||||||
|
return user.public;
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
myPrivKey: {
|
myPrivKey: {
|
||||||
get: () => user.private
|
get: () => {
|
||||||
|
try {
|
||||||
|
return user.private;
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user