Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type for userAuthParams in setUserWithAuthParams #135

Open
johankasperi opened this issue Sep 18, 2024 · 5 comments
Open

Incorrect type for userAuthParams in setUserWithAuthParams #135

johankasperi opened this issue Sep 18, 2024 · 5 comments

Comments

@johankasperi
Copy link

johankasperi commented Sep 18, 2024

userAuthParams: UserAuthParams,

Shouldn't it be:

userAuthParams: UserAuthParams | UserAuthWithEncryptionParams | UserAuthWithHashParams

so the function accepts for example digest in the params?

@pmerlet-at-didomi
Copy link
Contributor

Hello, UserAuthWithEncryptionParams and UserAuthWithHashParams both extend UserAuthParams. The function should accept digest without issue. Is it not the case?

@johankasperi
Copy link
Author

Hello, UserAuthWithEncryptionParams and UserAuthWithHashParams both extend UserAuthParams. The function should accept digest without issue. Is it not the case?

No that is not the case. That is not how TypeScript functions. Just because UserAuthWithEncryptionParams and UserAuthWithHashParams extends UserAuthParams doesn't mean that the function accepts these types.

@johankasperi
Copy link
Author

johankasperi commented Sep 19, 2024

Hello, UserAuthWithEncryptionParams and UserAuthWithHashParams both extend UserAuthParams. The function should accept digest without issue. Is it not the case?

No that is not the case. That is not how TypeScript functions. Just because UserAuthWithEncryptionParams and UserAuthWithHashParams extends UserAuthParams doesn't mean that the function accepts these types.

If I find the time I can make a PR that fixes this

@pmerlet-at-didomi
Copy link
Contributor

No pb, if this fixes the issue:

userAuthParams: UserAuthParams | UserAuthWithEncryptionParams | UserAuthWithHashParams

we can add it to the next release.

@johankasperi
Copy link
Author

No pb, if this fixes the issue:

userAuthParams: UserAuthParams | UserAuthWithEncryptionParams | UserAuthWithHashParams

we can add it to the next release.

Yes that will fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants