fix: remove built-in $authentication store #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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