@@ -130,6 +130,13 @@ firebase.UserInfo.prototype.displayName;
130
130
*/
131
131
firebase . UserInfo . prototype . photoURL ;
132
132
133
+ /**
134
+ * The user's E.164 formatted phone number (if available).
135
+ *
136
+ * @type {?string }
137
+ */
138
+ firebase . UserInfo . prototype . phoneNumber ;
139
+
133
140
/**
134
141
* A user account.
135
142
*
@@ -480,7 +487,7 @@ firebase.User.prototype.reauthenticateWithCredential = function(credential) {};
480
487
* </dl>
481
488
*
482
489
* @param {!firebase.auth.AuthCredential } credential
483
- * @return {!firebase.Promise<void > }
490
+ * @return {!firebase.Promise<!firebase.auth.UserCredential > }
484
491
*/
485
492
firebase . User . prototype . reauthenticateAndRetrieveDataWithCredential =
486
493
function ( credential ) { } ;
@@ -787,6 +794,69 @@ firebase.auth.Auth.prototype.app;
787
794
*/
788
795
firebase . auth . Auth . prototype . currentUser ;
789
796
797
+ /**
798
+ * @enum {string}
799
+ * An enumeration of the possible persistence mechanism types.
800
+ */
801
+ firebase . auth . Auth . Persistence = {
802
+ /**
803
+ * Indicates that the state will be persisted even when the browser window is
804
+ * closed or the activity is destroyed in react-native.
805
+ */
806
+ LOCAL : 'local' ,
807
+ /**
808
+ * Indicates that the state will only be stored in memory and will be cleared
809
+ * when the window or activity is refreshed.
810
+ */
811
+ NONE : 'none' ,
812
+ /**
813
+ * Indicates that the state will only persist in current session/tab, relevant
814
+ * to web only, and will be cleared when the tab is closed.
815
+ */
816
+ SESSION : 'session'
817
+ } ;
818
+
819
+ /**
820
+ * Changes the current type of persistence on the current Auth instance for the
821
+ * currently saved Auth session and applies this type of persistence for
822
+ * future sign-in requests, including sign-in with redirect requests. This will
823
+ * return a promise that will resolve once the state finishes copying from one
824
+ * type of storage to the other.
825
+ * Calling a sign-in method after changing persistence will wait for that
826
+ * persistence change to complete before applying it on the new Auth state.
827
+ *
828
+ * This makes it easy for a user signing in to specify whether their session
829
+ * should be remembered or not. It also makes it easier to never persist the
830
+ * Auth state for applications that are shared by other users or have sensitive
831
+ * data.
832
+ *
833
+ * The default for web browser apps and React Native apps is 'local' (provided
834
+ * the browser supports this mechanism) whereas it is 'none' for Node.js backend
835
+ * apps.
836
+ *
837
+ * <h4>Error Codes (thrown synchronously)</h4>
838
+ * <dl>
839
+ * <dt>auth/invalid-persistence-type</dt>
840
+ * <dd>Thrown if the specified persistence type is invalid.</dd>
841
+ * <dt>auth/unsupported-persistence-type</dt>
842
+ * <dd>Thrown if the current environment does not support the specified
843
+ * persistence type.</dd>
844
+ * </dl>
845
+ *
846
+ * @example
847
+ * firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION)
848
+ * .then(function() {
849
+ * // Existing and future Auth states are now persisted in the current
850
+ * // session only. Closing the window would clear any existing state even if
851
+ * // a user forgets to sign out.
852
+ * });
853
+ *
854
+ * @param {!firebase.auth.Auth.Persistence } persistence The auth state
855
+ * persistence mechanism.
856
+ * @return {!firebase.Promise<void> }
857
+ */
858
+ firebase . auth . Auth . prototype . setPersistence = function ( persistence ) { } ;
859
+
790
860
/**
791
861
* Creates a new user account associated with the specified email address and
792
862
* password.
@@ -1871,4 +1941,4 @@ firebase.auth.ApplicationVerifier.prototype.type;
1871
1941
* @return {!firebase.Promise<string> } A Promise for a token that can be used to
1872
1942
* assert the validity of a request.
1873
1943
*/
1874
- firebase . auth . ApplicationVerifier . prototype . verify = function ( ) { } ;
1944
+ firebase . auth . ApplicationVerifier . prototype . verify = function ( ) { } ;
0 commit comments