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

fix: Always decode the authToken when retrieving #23

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

mikebryant
Copy link
Contributor

No description provided.

@sgwilym
Copy link
Contributor

sgwilym commented Jun 5, 2024

Interesting! Does this fix the bug you reported where a situation that demanded a capability found undefined instead? And if so, how? As far as I understand this PR, no logic has changed, but some code has been consolidated?

@mikebryant
Copy link
Contributor Author

There are 3 cases where it's pulled out - two of them are currently decoding it, but this one isnt: https://github.com/earthstar-project/willow-js/pull/23/files#diff-b6dccdeff4ac0c74bf56d6387fb90af19ebd8718059842bad86fa1ef79482b4bL683

So the functional change here is for that case to now decode it.

And yeah, this should fix the issue - when I looked at the browser debug I was getting an object with jut the bytes method - it hadn't been decoded into the auth token object with a capability field etc

@sgwilym
Copy link
Contributor

sgwilym commented Jun 5, 2024

Thank you for the explanation, looks good to me!

@sgwilym sgwilym merged commit f2087e0 into earthstar-project:main Jun 5, 2024
1 check passed
@mikebryant mikebryant deleted the fix-authtoken-decoding branch June 11, 2024 16:58
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

Successfully merging this pull request may close these issues.

2 participants