monoidentity 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +1 -1
- package/dist/trackready.js +9 -9
- package/package.json +1 -1
package/dist/storage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const conf: (i: Record<string, string>, a: string) => void;
|
|
2
2
|
export declare const LOGIN_RECOGNIZED_PATH = ".core/login.encjson";
|
|
3
3
|
export declare const getLoginRecognized: () => {
|
|
4
4
|
email: string;
|
package/dist/storage.js
CHANGED
package/dist/trackready.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {} from "./utils-transport.js";
|
|
2
2
|
import { init as initLocal, wrapWithBackup } from "./storage/localstorage.js";
|
|
3
|
-
import { LOGIN_RECOGNIZED_PATH,
|
|
3
|
+
import { LOGIN_RECOGNIZED_PATH, conf } from "./storage.js";
|
|
4
4
|
export const trackReady = (app, intents, requestBackup, ready) => {
|
|
5
5
|
const params = new URLSearchParams(location.hash.slice(1));
|
|
6
|
-
let
|
|
7
|
-
? JSON.parse(localStorage
|
|
6
|
+
let setup = localStorage["monoidentity-x/setup"]
|
|
7
|
+
? JSON.parse(localStorage["monoidentity-x/setup"])
|
|
8
8
|
: undefined;
|
|
9
9
|
let provisions = [];
|
|
10
10
|
const cb = params.get("monoidentitycallback");
|
|
@@ -14,11 +14,11 @@ export const trackReady = (app, intents, requestBackup, ready) => {
|
|
|
14
14
|
}
|
|
15
15
|
for (const provision of provisions) {
|
|
16
16
|
if ("setup" in provision) {
|
|
17
|
-
|
|
18
|
-
localStorage
|
|
17
|
+
setup = provision.setup;
|
|
18
|
+
localStorage["monoidentity-x/setup"] = JSON.stringify(setup);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
if (!
|
|
21
|
+
if (!setup) {
|
|
22
22
|
const target = new URL("https://usemonoidentity.web.app");
|
|
23
23
|
target.hash = JSON.stringify({
|
|
24
24
|
intents: [{ storage: true }, ...intents],
|
|
@@ -28,18 +28,18 @@ export const trackReady = (app, intents, requestBackup, ready) => {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
let storage;
|
|
31
|
-
if (
|
|
31
|
+
if (setup.method == "cloud") {
|
|
32
32
|
// TODO
|
|
33
33
|
throw new Error("unimplemented");
|
|
34
34
|
}
|
|
35
|
-
else if (
|
|
35
|
+
else if (setup.method == "localStorage") {
|
|
36
36
|
storage = initLocal();
|
|
37
37
|
storage = wrapWithBackup(storage, requestBackup);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
throw new Error("unreachable");
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
conf(storage, app);
|
|
43
43
|
for (const provision of provisions) {
|
|
44
44
|
if ("createLoginRecognized" in provision) {
|
|
45
45
|
storage[LOGIN_RECOGNIZED_PATH] = provision.createLoginRecognized;
|