Skip to content

Commit 4544ba5

Browse files
committed
removing getters as they don't support tree-shakeable property
1 parent 15e2c25 commit 4544ba5

File tree

2 files changed

+5
-43
lines changed
  • packages/auth/src

2 files changed

+5
-43
lines changed

packages/auth/src/mfa/assertions/totp.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
* limitations under the License.
1616
*/
1717
import { TotpSecret } from '../../platform_browser/mfa/assertions/totp';
18-
import { TotpMultiFactorAssertion, MultiFactorSession } from '../../model/public_types';
19-
import { FactorId } from '../../model/enum_maps';
18+
import { TotpMultiFactorAssertion, MultiFactorSession, FactorId } from '../../model/public_types';
2019
/**
2120
* Provider for generating a {@link TotpMultiFactorAssertion}.
2221
*
@@ -68,7 +67,7 @@ export class TotpMultiFactorGenerator {
6867
throw new Error('Unimplemented');
6968
}
7069
/**
71-
* The identifier of the phone second factor: `totp`.
70+
* The identifier of the TOTP second factor: `totp`.
7271
*/
7372
static FACTOR_ID = FactorId.TOTP;
7473
}

packages/auth/src/platform_browser/mfa/assertions/totp.ts

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,51 +18,15 @@
1818
/**
1919
* Stores the shared secret key and other parameters to generate time-based OTPs.
2020
* Implements methods to retrieve the shared secret key, generate a QRCode URL.
21+
* @public
2122
*/
22-
2323
export class TotpSecret {
2424
constructor(
2525
readonly secretKey: string,
2626
readonly hashingAlgorithm: string,
2727
readonly codeLength: number,
2828
readonly codeIntervalSeconds: number
2929
) {}
30-
/**
31-
* Returns the shared secret key/seed used to generate time-based one-time passwords.
32-
*
33-
* @returns Shared secret key/seed used for enrolling in TOTP MFA and generating otps.
34-
*/
35-
sharedSecretKey(): string {
36-
return this.secretKey;
37-
}
38-
39-
/**
40-
* Returns the hashing algorithm used to generate time-based one-time passwords.
41-
*
42-
* @returns Hashing algorithm used.
43-
*/
44-
getHashingAlgorithm(): string {
45-
return this.hashingAlgorithm;
46-
}
47-
48-
/**
49-
* Returns the length of the OTP codes to be generated.
50-
*
51-
* @returns Length of the one-time passwords to be generated.
52-
*/
53-
getCodeLength(): number {
54-
return this.codeLength;
55-
}
56-
57-
/**
58-
* Returns the interval(in seconds) when the OTP codes should change.
59-
*
60-
* @returns The interval (in seconds) when the OTP codes should change.
61-
*/
62-
getCodeIntervalSeconds(): number {
63-
return this.codeIntervalSeconds;
64-
}
65-
6630
/**
6731
* Returns a QRCode URL as described in
6832
* https://github.com/google/google-authenticator/wiki/Key-Uri-Format
@@ -73,8 +37,7 @@ export class TotpSecret {
7337
* @param issuer issuer of the TOTP(likely the app name).
7438
* @returns A QRCode URL string.
7539
*/
76-
77-
generateQrCodeUrl(_accountName?: string, issuer?: string): string {
78-
return null as any;
40+
generateQrCodeUrl(_accountName?: string, _issuer?: string): string {
41+
throw new Error('Unimplemented');
7942
}
8043
}

0 commit comments

Comments
 (0)