Home > @firebase/auth > onIdTokenChanged
onIdTokenChanged() function
Adds an observer for changes to the signed-in user's ID token, which includes sign-in, sign-out, and token refresh events.
Signature:
export declare function onIdTokenChanged(auth: Auth, nextOrObserver: NextOrObserver<User>, error?: ErrorFn, completed?: CompleteFn): Unsubscribe;
Parameters
Parameter | Type | Description |
---|---|---|
auth | Auth | The Auth instance. |
nextOrObserver | NextOrObserver<User> | callback triggered on change. |
error | ErrorFn | callback triggered on error. |
completed | CompleteFn | callback triggered when observer is removed. |
Returns:
Unsubscribe