[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-01-23 UTC."],[],[],null,["# firebase::auth::AuthStateListener Class Reference\n\nfirebase::auth::AuthStateListener\n=================================\n\n\n**This is an abstract class.**\n\n\n`#include \u003cauth.h\u003e`\n\nListener called when there is a change in the authentication state.\n\nSummary\n-------\n\nOverride base class method to handle authentication state changes. Methods are invoked asynchronously and may be invoked on other threads.\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~AuthStateListener](#classfirebase_1_1auth_1_1_auth_state_listener_1a1674fd3c94c8155ad79361b66f9eb487)`()` ||\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|\n| [OnAuthStateChanged](#classfirebase_1_1auth_1_1_auth_state_listener_1a9ac0823945bfbd7074ad140a3206fd00)`(`[Auth](/docs/reference/cpp/class/firebase/auth/auth#classfirebase_1_1auth_1_1_auth)` *auth)=0` | `virtual void` Called when the authentication state of `auth` changes. |\n\nPublic functions\n----------------\n\n### OnAuthStateChanged\n\n```c++\nvirtual void OnAuthStateChanged(\n Auth *auth\n)=0\n``` \nCalled when the authentication state of `auth` changes.\n\n\n- Right after the listener has been registered\n- When a user is signed in\n- When the current user is signed out\n- When the current user changes\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `auth` | Disambiguates which [Auth](/docs/reference/cpp/class/firebase/auth/auth#classfirebase_1_1auth_1_1_auth) instance the event corresponds to, in the case where you are using more than one at the same time. | |\n\n### \\~AuthStateListener\n\n```c++\nvirtual ~AuthStateListener()\n``` \n\n| **Note:** : Destruction of the listener automatically calls RemoveAuthStateListener() from the Auths this listener is registered with, if those Auths have not yet been destroyed.\n\n\u003cbr /\u003e"]]