Skip to content

Commit 54aeb97

Browse files
committed
release v2.2.49
+ fix: DemosWebAuth identity create not working
1 parent 58189f9 commit 54aeb97

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kynesyslabs/demosdk",
3-
"version": "2.2.48",
3+
"version": "2.2.49",
44
"main": "build/index.js",
55
"types": "build/index.d.ts",
66
"author": "Kynesys Labs",

src/websdk/DemosWebAuth.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,20 @@ export class DemosWebAuth {
3737
}
3838

3939
async create(seed = "") {
40-
if (!seed) {
41-
seed = forge.random.getBytesSync(32)
42-
}
4340
let result: [boolean, IKeyPair] = [true, {} as any]
4441

4542
try {
4643
this.keypair = {
4744
privateKey: null,
4845
publicKey: null,
4946
}
50-
this.keypair = Cryptography.newFromSeed(seed)
47+
48+
if (!seed) {
49+
this.keypair = Cryptography.new()
50+
} else {
51+
this.keypair = Cryptography.newFromSeed(seed)
52+
}
53+
5154
this.loggedIn = true
5255
// Stringify the keypair
5356
this.stringified_keypair = {
@@ -56,9 +59,11 @@ export class DemosWebAuth {
5659
}
5760
result = [true, this.keypair]
5861
} catch (e) {
62+
console.error(e)
5963
// @ts-expect-error
6064
result = [false, "[CREATE WALLET ERROR] " + e.message]
6165
}
66+
6267
return result
6368
}
6469

0 commit comments

Comments
 (0)