File tree 4 files changed +24
-5
lines changed
4 files changed +24
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @firebase/auth " : patch
3
+ ---
4
+
5
+ Add missing PhoneMultiFactorInfo public interface
Original file line number Diff line number Diff line change @@ -601,6 +601,11 @@ export class PhoneMultiFactorGenerator {
601
601
static FACTOR_ID: string ;
602
602
}
603
603
604
+ // @public
605
+ export interface PhoneMultiFactorInfo extends MultiFactorInfo {
606
+ readonly phoneNumber: string ;
607
+ }
608
+
604
609
// @public
605
610
export interface PhoneMultiFactorSignInInfoOptions {
606
611
multiFactorHint? : MultiFactorInfo ;
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
- import { FactorId , MultiFactorInfo } from '../model/public_types' ;
18
+ import { FactorId , MultiFactorInfo , PhoneMultiFactorInfo } from '../model/public_types' ;
19
19
import {
20
20
PhoneMfaEnrollment ,
21
21
MfaEnrollment
@@ -40,13 +40,13 @@ export abstract class MultiFactorInfoImpl implements MultiFactorInfo {
40
40
enrollment : MfaEnrollment
41
41
) : MultiFactorInfoImpl {
42
42
if ( 'phoneInfo' in enrollment ) {
43
- return PhoneMultiFactorInfo . _fromServerResponse ( auth , enrollment ) ;
43
+ return PhoneMultiFactorInfoImpl . _fromServerResponse ( auth , enrollment ) ;
44
44
}
45
45
return _fail ( auth , AuthErrorCode . INTERNAL_ERROR ) ;
46
46
}
47
47
}
48
48
49
- export class PhoneMultiFactorInfo extends MultiFactorInfoImpl {
49
+ export class PhoneMultiFactorInfoImpl extends MultiFactorInfoImpl implements PhoneMultiFactorInfo {
50
50
readonly phoneNumber : string ;
51
51
52
52
private constructor ( response : PhoneMfaEnrollment ) {
@@ -57,7 +57,7 @@ export class PhoneMultiFactorInfo extends MultiFactorInfoImpl {
57
57
static _fromServerResponse (
58
58
_auth : AuthInternal ,
59
59
enrollment : MfaEnrollment
60
- ) : PhoneMultiFactorInfo {
61
- return new PhoneMultiFactorInfo ( enrollment ) ;
60
+ ) : PhoneMultiFactorInfoImpl {
61
+ return new PhoneMultiFactorInfoImpl ( enrollment ) ;
62
62
}
63
63
}
Original file line number Diff line number Diff line change @@ -628,6 +628,15 @@ export interface MultiFactorInfo {
628
628
readonly factorId : typeof FactorIdMap [ keyof typeof FactorIdMap ] ;
629
629
}
630
630
631
+ /**
632
+ * The subclass of the {@link MultiFactorInfo} interface for phone number
633
+ * second factors. The factorId of this second factor is {@link FactorId.PHONE}.
634
+ */
635
+ export interface PhoneMultiFactorInfo extends MultiFactorInfo {
636
+ /** The phone number associated with the current second factor. */
637
+ readonly phoneNumber : string ;
638
+ }
639
+
631
640
/**
632
641
* The class used to facilitate recovery from {@link MultiFactorError} when a user needs to
633
642
* provide a second factor to sign in.
You can’t perform that action at this time.
0 commit comments