@@ -18,19 +18,19 @@ import {
18
18
TotpMultiFactorAssertion ,
19
19
MultiFactorSession ,
20
20
FactorId
21
- } from '../../model/public_types' ;
22
- import { AuthInternal } from '../../model/auth' ;
21
+ } from '../../../ model/public_types' ;
22
+ import { AuthInternal } from '../../../ model/auth' ;
23
23
import {
24
24
finalizeEnrollTotpMfa ,
25
25
startEnrollTotpMfa ,
26
26
StartTotpMfaEnrollmentResponse ,
27
27
TotpVerificationInfo
28
- } from '../../api/account_management/mfa' ;
29
- import { FinalizeMfaResponse } from '../../api/authentication/mfa' ;
30
- import { MultiFactorAssertionImpl } from '../../mfa/mfa_assertion' ;
31
- import { MultiFactorSessionImpl } from '../mfa_session' ;
32
- import { AuthErrorCode } from '../../core/errors' ;
33
- import { _assert } from '../../core/util/assert' ;
28
+ } from '../../../ api/account_management/mfa' ;
29
+ import { FinalizeMfaResponse } from '../../../ api/authentication/mfa' ;
30
+ import { MultiFactorAssertionImpl } from '../../../ mfa/mfa_assertion' ;
31
+ import { MultiFactorSessionImpl } from '../../ mfa_session' ;
32
+ import { AuthErrorCode } from '../../../ core/errors' ;
33
+ import { _assert } from '../../../ core/util/assert' ;
34
34
35
35
/**
36
36
* Provider for generating a {@link TotpMultiFactorAssertion}.
@@ -95,7 +95,7 @@ export class TotpMultiFactorGenerator {
95
95
idToken : mfaSession . credential ,
96
96
totpEnrollmentInfo : { }
97
97
} ) ;
98
- return TotpSecret . fromStartTotpMfaEnrollmentResponse (
98
+ return TotpSecret . _fromStartTotpMfaEnrollmentResponse (
99
99
response ,
100
100
mfaSession . auth
101
101
) ;
@@ -119,25 +119,20 @@ export class TotpMultiFactorAssertionImpl
119
119
super ( FactorId . TOTP ) ;
120
120
}
121
121
122
+ /** @internal */
122
123
static _fromSecret (
123
124
secret : TotpSecret ,
124
125
otp : string
125
126
) : TotpMultiFactorAssertionImpl {
126
- return new TotpMultiFactorAssertionImpl (
127
- ( otp = otp ) ,
128
- undefined ,
129
- ( secret = secret )
130
- ) ;
127
+ return new TotpMultiFactorAssertionImpl ( otp , undefined , secret ) ;
131
128
}
132
129
130
+ /** @internal */
133
131
static _fromEnrollmentId (
134
132
enrollmentId : string ,
135
133
otp : string
136
134
) : TotpMultiFactorAssertionImpl {
137
- return new TotpMultiFactorAssertionImpl (
138
- ( otp = otp ) ,
139
- ( enrollmentId = enrollmentId )
140
- ) ;
135
+ return new TotpMultiFactorAssertionImpl ( otp , enrollmentId ) ;
141
136
}
142
137
143
138
/** @internal */
@@ -154,7 +149,7 @@ export class TotpMultiFactorAssertionImpl
154
149
return finalizeEnrollTotpMfa ( auth , {
155
150
idToken,
156
151
displayName,
157
- totpVerificationInfo : this . secret . makeTotpVerificationInfo ( this . otp )
152
+ totpVerificationInfo : this . secret . _makeTotpVerificationInfo ( this . otp )
158
153
} ) ;
159
154
}
160
155
@@ -194,7 +189,8 @@ export class TotpSecret {
194
189
private readonly auth : AuthInternal
195
190
) { }
196
191
197
- static fromStartTotpMfaEnrollmentResponse (
192
+ /** @internal */
193
+ static _fromStartTotpMfaEnrollmentResponse (
198
194
response : StartTotpMfaEnrollmentResponse ,
199
195
auth : AuthInternal
200
196
) : TotpSecret {
@@ -209,7 +205,8 @@ export class TotpSecret {
209
205
) ;
210
206
}
211
207
212
- makeTotpVerificationInfo ( otp : string ) : TotpVerificationInfo {
208
+ /** @internal */
209
+ _makeTotpVerificationInfo ( otp : string ) : TotpVerificationInfo {
213
210
return { sessionInfo : this . sessionInfo , verificationCode : otp } ;
214
211
}
215
212
@@ -240,6 +237,7 @@ export class TotpSecret {
240
237
}
241
238
}
242
239
240
+ /** @internal */
243
241
function _isEmptyString ( input ?: string ) : boolean {
244
242
return typeof input === 'undefined' || input ?. length === 0 ;
245
243
}
0 commit comments