This commit is contained in:
Manav Rathi 2024-05-24 12:38:35 +05:30
parent 05e737cb11
commit 370b28f9e4
No known key found for this signature in database

View file

@ -91,7 +91,7 @@ const _codeFromURIString = (id: string, uriString: string): Code => {
type, type,
account: parseAccount(path), account: parseAccount(path),
issuer: parseIssuer(url, path), issuer: parseIssuer(url, path),
length: parseLength(url), length: parseLength(url, type),
period: parsePeriod(url), period: parsePeriod(url),
secret: parseSecret(url), secret: parseSecret(url),
algorithm: parseAlgorithm(url), algorithm: parseAlgorithm(url),
@ -182,7 +182,7 @@ export const generateOTPs = (code: Code): [otp: string, nextOTP: string] => {
secret: code.secret, secret: code.secret,
algorithm: code.algorithm, algorithm: code.algorithm,
period: code.period, period: code.period,
digits: code.digits, digits: code.length,
}); });
otp = totp.generate(); otp = totp.generate();
nextOTP = totp.generate({ nextOTP = totp.generate({
@ -238,7 +238,7 @@ class Steam {
this.period = 30; this.period = 30;
} }
generate({ timestamp = Date.now() }: { timestamp: number }) { generate({ timestamp }: { timestamp: number } = { timestamp: Date.now() }) {
return `${timestamp}`; return `${timestamp}`;
} }
} }