bytesbay / web3-token

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

Property 'domain' of type 'string | undefined' is not assignable to 'string' index type 'string | string[] #45

Closed alvaro-7x closed 2 years ago

alvaro-7x commented 2 years ago

Hi, I get the errors

Property 'domain' of type 'string | undefined' is not assignable to 'string' index type 'string | string[]' Property 'statement' of type 'string | undefined' is not assignable to 'string' index type 'string | string[]'

in Angular 13 when I use

const token = await sign( (msg) => web3.eth.personal.sign(msg, address,""), '1d');

now it would be advisable to add undefined in the VerifyBody interface of the web3-token.d.ts file in line 15 ?

https://github.com/bytesbay/web3-token/blob/7d26edba607ee0256cce8820785120e686fdc68d/dist/web3-token.d.ts#L15-L18

Result:

interface VerifyBody extends Record<string, string | string[] | undefined> {

bytesbay commented 2 years ago

Fixed in the latest version

alvaro-7x commented 2 years ago

ok, thanks


De: Miroslaw Shpak @.> Enviado: domingo, 4 de septiembre de 2022 10:39 Para: bytesbay/web3-token @.> Cc: Alvaro @.>; Author @.> Asunto: Re: [bytesbay/web3-token] Property 'domain' of type 'string | undefined' is not assignable to 'string' index type 'string | string[] (Issue #45)

Fixed in the latest version

— Reply to this email directly, view it on GitHubhttps://github.com/bytesbay/web3-token/issues/45#issuecomment-1236356063, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADYV5T7PXYGLLTVDD64WYJDV4SYDLANCNFSM57YXOYHA. You are receiving this because you authored the thread.Message ID: @.***>