refresh method
Refreshes the accounts idToken and returns the new token.
Sends the refreshToken to the firebase server to obtain a new idToken.
On a success, the idToken and refreshToken properties are updated and
idTokenStream provides a new value. If the request fails, an AuthError
is thrown.
Note: Instead of manually refreshing whenever expiresAt comes close, you can simply set autoRefresh to true to enable automatic refreshing of the idToken in the background.
Implementation
Future<String> refresh() async {
await _updateToken();
return _idToken;
}