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: remove built-in $authentication store #25

Merged
merged 1 commit into from
Oct 25, 2024
Merged

fix: remove built-in $authentication store #25

merged 1 commit into from
Oct 25, 2024

Conversation

wkillerud
Copy link
Contributor

This feature was intended to be an easier API for a built-in hybrid message[^1], but turned out to be problematic. By design the store will emit its value on the message bus if the message bus has no previous message for the channel and topic.

For authentication in a hybrid webview there is no client-side initial value (it's an Authorization HTTP request header). Unless a client-side script primes the message bus with a fake message on "system/authentication", this store ends up sending a signal to the native side that the user has logged out (authentication token is null).

Since the method to detect login state and prime the message bus will be different from case to case, this built-in store is removed.

BREAKING CHANGE: $authentication is removed

This feature was intended to be an easier API for a built-in
hybrid message[^1], but turned out to be problematic. By design
the store will emit its value on the message bus if the message
bus has no previous message for the channel and topic.

For authentication in a hybrid webview there is no client-side
initial value (it's an Authorization HTTP request header). Unless
a client-side script primes the message bus with a fake message
on "system/authentication", this store ends up sending a signal
to the native side that the user has logged out (authentication
token is null).

Since the method to detect login state and prime the message
bus will be different from case to case, this built-in store
is removed.

BREAKING CHANGE: $authentication is removed

[1]: https://podium-lib.io/docs/guides/hybrid#message-contracts
wkillerud added a commit to podium-lib/podium-lib.github.io that referenced this pull request Oct 25, 2024
@wkillerud wkillerud merged commit d726b24 into main Oct 25, 2024
1 check passed
@wkillerud wkillerud deleted the no-built-in branch October 25, 2024 13:43
wkillerud added a commit to podium-lib/podium-lib.github.io that referenced this pull request Oct 25, 2024
github-actions bot pushed a commit that referenced this pull request Oct 25, 2024
# [2.0.0](v1.1.0...v2.0.0) (2024-10-25)

### Bug Fixes

* remove built-in $authentication store ([#25](#25)) ([d726b24](d726b24))

### BREAKING CHANGES

* $authentication is removed

[1]: https://podium-lib.io/docs/guides/hybrid#message-contracts
Copy link

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

1 participant