feat: added sort for totps, added possibility to change issuer and client name
This commit is contained in:
@@ -48,12 +48,17 @@ export class TOTP {
|
||||
*/
|
||||
getOTP(time = Date.now()) {
|
||||
const unixTime = (time / 1000 + this.timeOffset) / this.fetchTime;
|
||||
const otp = getHOTP(Math.floor(unixTime), this.secret, this.digits, this.hashType);
|
||||
const otp = getHOTP(
|
||||
Math.floor(unixTime),
|
||||
this.secret,
|
||||
this.digits,
|
||||
this.hashType,
|
||||
);
|
||||
const expireTime =
|
||||
time +
|
||||
(this.fetchTime -
|
||||
((time / 1000 + this.timeOffset) % this.fetchTime)) *
|
||||
1000;
|
||||
1000;
|
||||
const createdTime =
|
||||
time - ((time / 1000 + this.timeOffset) % this.fetchTime) * 1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user