From 383aef8b6c0d171ee01942ffc49218e3d779dad5 Mon Sep 17 00:00:00 2001 From: Ehsan Barooni <66495214+ebarooni@users.noreply.github.com> Date: Mon, 4 Nov 2024 22:42:42 +0100 Subject: [PATCH] feat: extend authentication to support id token change event (#710) * adds type definitions --- packages/authentication/src/definitions.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/authentication/src/definitions.ts b/packages/authentication/src/definitions.ts index fcd993b3..2bdf026e 100644 --- a/packages/authentication/src/definitions.ts +++ b/packages/authentication/src/definitions.ts @@ -483,6 +483,17 @@ export interface FirebaseAuthenticationPlugin { eventName: 'authStateChange', listenerFunc: AuthStateChangeListener, ): Promise; + /** + * Listen for changes to the signed-in user's ID token changes. + * + * **Attention:** This listener will not be triggered automatically upon ID token expiration. + * + * @since TODO: Add since for idTokenChange + */ + addListener( + eventName: 'idTokenChange', + listenerFunc: AuthStateChangeListener, + ): Promise; /** * Listen for a completed phone verification. *