@open-pioneer/authentication@2.4.0
github-actions
released this
05 Dec 15:12
·
3 commits
to main
since this release
Minor Changes
-
1ce5f11: Replace change events for auth state with signals from Reactivity API
Example: watch for updates of the auth state
const myAuthService = ... watch( () => [myAuthService.getAuthState()], ([state]) => { console.log(state); }, { immediate: true } );
The Auth Service forwards the auth state from the underlying AuthPlugin.
Therefore, the plugin implementation must use reactive signals when its auth state changes in order to signal changes to the service.class DummyPlugin implements AuthPlugin { #state = reactive<AuthState>({ kind: "not-authenticated" }); getAuthState(): AuthState { return this.#state.value; } $setAuthState(newState: AuthState) { this.#state.value = newState; } }