Skip to content

Commit 92ff805

Browse files
committed
removing getters as they don't support tree-shakeable property
1 parent 42b7565 commit 92ff805

File tree

2 files changed

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

2 files changed

+5
-40
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class TotpMultiFactorGenerator {
6868
throw new Error('Unimplemented');
6969
}
7070
/**
71-
* The identifier of the phone second factor: `totp`.
71+
* The identifier of the TOTP second factor: `totp`.
7272
*/
7373
static FACTOR_ID = FactorId.TOTP;
7474
}

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

+4-39
Original file line numberDiff line numberDiff line change
@@ -18,51 +18,16 @@
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-
30+
6631
/**
6732
* Returns a QRCode URL as described in
6833
* https://github.com/google/google-authenticator/wiki/Key-Uri-Format
@@ -74,7 +39,7 @@ export class TotpSecret {
7439
* @returns A QRCode URL string.
7540
*/
7641

77-
generateQrCodeUrl(_accountName?: string, issuer?: string): string {
78-
return null as any;
42+
generateQrCodeUrl(_accountName?: string, _issuer?: string): string {
43+
throw new Error('Unimplemented');
7944
}
8045
}

0 commit comments

Comments
 (0)