idTokenStream property

Stream<String> get idTokenStream

A broadcast stream of idTokens.

Generates a new token everytime the users credentials are refreshed via refresh() or autoRefresh. The stream is a broadcast stream, so you can listen to it as you please.

Whenever a new token is returned, idToken has also been updated. However, no intial event is sent to the stream when you subscribe. If an error happens during a refresh, the AuthError is passed as error to the stream, so you can react to these.

Note: If no stream is connected, refresh errors fail silently.

Implementation

Stream<String> get idTokenStream => _refreshController.stream;