bytesbay / web3-token

Web3 Token is a new way to authenticate users in a hybrid dApps using signed messages. Implementation of EIP-4361.
380 stars 50 forks source link

Incorrect type for verify() output #43

Closed bluenex closed 2 years ago

bluenex commented 2 years ago

The actual output object looks like this:

{
  address: string;
  body: {
    "expiration-time": string;
    "issued-at": string;
    "nonce": string;
    "uri": string;
    "web3-token-version": string;
  }
}

But the type defined is this:

https://github.com/bytesbay/web3-token/blob/da90d152bb4ba0b07933bf2b65434f7c5d5d238f/src/lib.d.ts#L25-L31

The problem is VerifyBody doesn't have those fields mentioned above. I think having another type for verifying result is reasonable (probably as VerifyResult).

bytesbay commented 2 years ago

Fixed in the latest version