Home > @firebase/auth > User > getIdToken
User.getIdToken() method
Returns a JSON Web Token (JWT) used to identify the user to a Firebase service.
Signature:
getIdToken(forceRefresh?: boolean): Promise<string>;
Parameters
Parameter | Type | Description |
---|---|---|
forceRefresh | boolean | Force refresh regardless of token expiration. |
Returns:
Promise<string>
Description
Returns the current token if it has not expired or if it will not expire in the next five minutes. Otherwise, this will refresh the token and return a new one.