You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the @stellar/typescript-wallet-sdk lacks a straightforward method for reusing an AuthToken obtained from the SEP-10 authentication process. When attempting to invoke AuthToken.from(string) to deserialize a previously acquired token, developers encounter the following error:
And we also cannot directly use string of AuthToken across different SEP interactions, as the SDK performs type checks on the AuthToken parameter.
What would you like to see?
A resolution to the module resolution error associated with the AuthToken.from() method is desired. This would enable us to seamlessly deserialize JWT strings into AuthToken instances, reuse throughout the token's validity period.
What alternatives are there?
In the absence of a direct solution, I used resort to creating custom classes that mimic the structure of AuthToken. And then use type assertions, such as as unknown as AuthToken, to cast these custom instances to the desired type. While this approach can be functional, it is not ideal and may lead to maintenance challenges.
The text was updated successfully, but these errors were encountered:
Normally, you should not need to convert string -> AuthToken, by authenticating directly with the anchor and then using AuthToken you get in return.
Is there any reason you want to construct AuthToken from string directly?
cc @CassioMG
The first parameter of this function requires the AuthToken type to be passed in, but when I only store string in my storage, and when I get it again, and use AuthToken.from(), the problem I mentioned above will arise.
What problem does your feature solve?
The current implementation of the @stellar/typescript-wallet-sdk lacks a straightforward method for reusing an AuthToken obtained from the SEP-10 authentication process. When attempting to invoke AuthToken.from(string) to deserialize a previously acquired token, developers encounter the following error:
And we also cannot directly use string of AuthToken across different SEP interactions, as the SDK performs type checks on the AuthToken parameter.
What would you like to see?
A resolution to the module resolution error associated with the AuthToken.from() method is desired. This would enable us to seamlessly deserialize JWT strings into AuthToken instances, reuse throughout the token's validity period.
What alternatives are there?
In the absence of a direct solution, I used resort to creating custom classes that mimic the structure of AuthToken. And then use type assertions, such as
as unknown as AuthToken
, to cast these custom instances to the desired type. While this approach can be functional, it is not ideal and may lead to maintenance challenges.The text was updated successfully, but these errors were encountered: