UNPKG

veritatisdoloremque

Version:
35 lines (22 loc) 1.05 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@firebase/auth-types](./auth-types.md) &gt; [Auth](./auth-types.auth.md) &gt; [onAuthStateChanged](./auth-types.auth.onauthstatechanged.md) ## Auth.onAuthStateChanged() method Adds an observer for changes to the user's sign-in state. <b>Signature:</b> ```typescript onAuthStateChanged( nextOrObserver: NextOrObserver<User | null>, error?: ErrorFn, completed?: CompleteFn ): Unsubscribe; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | nextOrObserver | [NextOrObserver](./auth-types.nextorobserver.md)<!-- -->&lt;[User](./auth-types.user.md) \| null&gt; | callback triggered on change. | | error | ErrorFn | callback triggered on error. | | completed | CompleteFn | callback triggered when observer is removed. | <b>Returns:</b> Unsubscribe ## Remarks To keep the old behavior, see [Auth.onIdTokenChanged()](./auth-types.auth.onidtokenchanged.md)<!-- -->.