@secrecy/lib 1.73.4 → 1.73.5
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/lib/client/helpers.js +23 -20
- package/package.json +1 -1
|
@@ -19,30 +19,33 @@ export function parseInfos() {
|
|
|
19
19
|
}
|
|
20
20
|
export function getSecrecyClient(opts = {}) {
|
|
21
21
|
const storage = getStorage(opts.session);
|
|
22
|
+
const infos = parseInfos();
|
|
23
|
+
if (infos !== null) {
|
|
24
|
+
storage.userAppKeys.save(infos.keys);
|
|
25
|
+
storage.userAppSession.save(infos.uaSession);
|
|
26
|
+
storage.jwt.save(infos.jwt);
|
|
27
|
+
return new SecrecyClient({
|
|
28
|
+
uaSession: infos.uaSession,
|
|
29
|
+
uaKeys: infos.keys,
|
|
30
|
+
uaJwt: infos.jwt,
|
|
31
|
+
secrecyUrls: opts.secrecyUrls,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
22
34
|
const uaSession = storage.userAppSession.load();
|
|
23
35
|
const uaKeys = storage.userAppKeys.load();
|
|
24
36
|
const uaJwt = storage.jwt.load();
|
|
25
|
-
if (uaSession
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
secrecyUrls: opts.secrecyUrls,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return null;
|
|
37
|
+
if (uaSession && uaKeys && uaJwt) {
|
|
38
|
+
storage.userAppKeys.save(uaKeys);
|
|
39
|
+
storage.userAppSession.save(uaSession);
|
|
40
|
+
storage.jwt.save(uaJwt);
|
|
41
|
+
return new SecrecyClient({
|
|
42
|
+
uaSession,
|
|
43
|
+
uaKeys,
|
|
44
|
+
uaJwt,
|
|
45
|
+
secrecyUrls: opts.secrecyUrls,
|
|
46
|
+
});
|
|
39
47
|
}
|
|
40
|
-
return
|
|
41
|
-
uaSession: uaSession,
|
|
42
|
-
uaKeys: uaKeys,
|
|
43
|
-
uaJwt: uaJwt,
|
|
44
|
-
secrecyUrls: opts.secrecyUrls,
|
|
45
|
-
});
|
|
48
|
+
return null;
|
|
46
49
|
}
|
|
47
50
|
export async function login({ appId, context, path, redirect, scopes, backPath, session, secrecyUrls, }) {
|
|
48
51
|
return await new Promise(async (resolve, reject) => {
|
package/package.json
CHANGED