This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
35 lines (31 loc) · 1.93 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html>
<script type="module">
import {SignUp, SignIn, ChangePassword, SimClient, TideJWT, EdDSA, Point, Utils} from "/modules/TideJS/index.js";
// Sign Up
var cmkOrks = [["2527689245118197790113231778399786267654070552711339962487622855626901589953", "http://host.docker.internal:1001", Point.fromB64("WGZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmY=")], ["6393847925575234000169843195548208585270417612196919584745964877580038090425", "http://host.docker.internal:1003", Point.fromB64("1LT1eEhowwIEAyRnF+wWn/eeJmCOoSahq2nud9GxZxI=")], ["4632947133711470616417116433625114571768440046220722468064461787170709195526", "http://host.docker.internal:1002", Point.fromB64("yaP4aq5GXw5WUThkUQ85l1YfosnoXqIdwikjCfPNYCI=")], ["1236192107091201142435240383373704537094513494254495780082080673750870608619", "http://host.docker.internal:1004", Point.fromB64("LxEyymGrON/wDy/qMijyTGxx1YCFuA5H4ZUVyyfo0Ec=")], ["1688896922719992198562411318292378855138814747620597373779036533530118166363", "http://host.docker.internal:1005", Point.fromB64("7ch21oMf0hBdC0OJyi4oMWZGkokUbizgb67+mLIlSN8=")]];
var cvkOrks = cmkOrks;
var config = {
cmkOrkInfo: cmkOrks,
cvkOrkInfo: cvkOrks,
}
var su = new SignUp(config);
var user = Date.now().toString();
var gVVK = "WGZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmY=";
await su.start(user, "a", gVVK);
var jwt1 = await su.continue();
console.log("Sign up good " + jwt1);
// Change Password
var cp = new ChangePassword();
await cp.start(user, "a", "b", gVVK);
await cp.continue();
console.log("Change password good")
// Sign In
var newConfig = {
mode: "default"
}
var si = new SignIn(newConfig);
await si.start(user, "b", gVVK);
var jwt = await si.continue();
console.log("Sign in good " + jwt);
</script>
</html>