fix, chore, feat: refactor of settings app, fix of Google Auth migration parse, added rename button(testing), added sort feature, added timeout to screen turning off, formated codes with space between 6-digits codes
Co-authored-by: DemiarUA <demiar97@gmail.com> https://github.com/Lisoveliy/totpfit/pull/1
This commit is contained in:
@@ -1,36 +1,37 @@
|
||||
import { Buffer } from 'buffer'
|
||||
import { Buffer } from "buffer";
|
||||
|
||||
export function parseInput(input) {
|
||||
const normalizedInput = input.replace(/\s/g, "");
|
||||
const normalizedHexInput = normalizedInput.replace(/0x/g, "").toLowerCase();
|
||||
if (isHex(normalizedHexInput)) {
|
||||
return Buffer.from(normalizedHexInput, "hex");
|
||||
} else {
|
||||
return Buffer.from(normalizedInput, "base64");
|
||||
}
|
||||
const normalizedInput = input.replace(/\s/g, "");
|
||||
const normalizedHexInput = normalizedInput.replace(/0x/g, "").toLowerCase();
|
||||
if (isHex(normalizedHexInput)) {
|
||||
return Buffer.from(normalizedHexInput, "hex");
|
||||
} else {
|
||||
return Buffer.from(normalizedInput, "base64");
|
||||
}
|
||||
}
|
||||
|
||||
export function isHex(string) {
|
||||
let result = true;
|
||||
for (const char of string) {
|
||||
if (!((char >= "a" && char <= "f") || (char >= "0" && char <= "9"))) {
|
||||
result = false;
|
||||
let result = true;
|
||||
for (const char of string) {
|
||||
if (!((char >= "a" && char <= "f") || (char >= "0" && char <= "9"))) {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
export function bufferLeToBeHex(buffer) {
|
||||
let output = "";
|
||||
for (const v of buffer) {
|
||||
const hex = v.toString(16);
|
||||
if (hex.length === 1) {
|
||||
output = "0" + hex + output;
|
||||
} else {
|
||||
output = hex + output;
|
||||
let output = "";
|
||||
for (const v of buffer) {
|
||||
const hex = v.toString(16);
|
||||
if (hex.length === 1) {
|
||||
output = "0" + hex + output;
|
||||
} else {
|
||||
output = hex + output;
|
||||
}
|
||||
}
|
||||
}
|
||||
return output;
|
||||
return output;
|
||||
}
|
||||
|
||||
export const bufferToPrettyHex = b => [...b].map(c => c.toString(16).padStart(2, '0')).join(' ');
|
||||
export const bufferToPrettyHex = (b) =>
|
||||
[...b].map((c) => c.toString(16).padStart(2, "0")).join(" ");
|
||||
|
||||
@@ -1,132 +1,132 @@
|
||||
import { decodeVarint } from "./varintUtils";
|
||||
|
||||
export class BufferReader {
|
||||
constructor(buffer) {
|
||||
this.buffer = buffer;
|
||||
this.offset = 0;
|
||||
}
|
||||
|
||||
readVarInt() {
|
||||
const result = decodeVarint(this.buffer, this.offset);
|
||||
this.offset += result.length;
|
||||
|
||||
return result.value;
|
||||
}
|
||||
|
||||
readBuffer(length) {
|
||||
this.checkByte(length);
|
||||
const result = this.buffer.slice(this.offset, this.offset + length);
|
||||
this.offset += length;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// gRPC has some additional header - remove it
|
||||
trySkipGrpcHeader() {
|
||||
const backupOffset = this.offset;
|
||||
|
||||
if (this.buffer[this.offset] === 0 && this.leftBytes() >= 5) {
|
||||
this.offset++;
|
||||
const length = this.buffer.readInt32BE(this.offset);
|
||||
this.offset += 4;
|
||||
|
||||
if (length > this.leftBytes()) {
|
||||
// Something is wrong, revert
|
||||
this.offset = backupOffset;
|
||||
}
|
||||
constructor(buffer) {
|
||||
this.buffer = buffer;
|
||||
this.offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
leftBytes() {
|
||||
return this.buffer.length - this.offset;
|
||||
}
|
||||
readVarInt() {
|
||||
const result = decodeVarint(this.buffer, this.offset);
|
||||
this.offset += result.length;
|
||||
|
||||
checkByte(length) {
|
||||
const bytesAvailable = this.leftBytes();
|
||||
if (length > bytesAvailable) {
|
||||
throw new Error(
|
||||
"Not enough bytes left. Requested: " +
|
||||
length +
|
||||
" left: " +
|
||||
bytesAvailable
|
||||
);
|
||||
return result.value;
|
||||
}
|
||||
}
|
||||
|
||||
checkpoint() {
|
||||
this.savedOffset = this.offset;
|
||||
}
|
||||
readBuffer(length) {
|
||||
this.checkByte(length);
|
||||
const result = this.buffer.slice(this.offset, this.offset + length);
|
||||
this.offset += length;
|
||||
|
||||
resetToCheckpoint() {
|
||||
this.offset = this.savedOffset;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// gRPC has some additional header - remove it
|
||||
trySkipGrpcHeader() {
|
||||
const backupOffset = this.offset;
|
||||
|
||||
if (this.buffer[this.offset] === 0 && this.leftBytes() >= 5) {
|
||||
this.offset++;
|
||||
const length = this.buffer.readInt32BE(this.offset);
|
||||
this.offset += 4;
|
||||
|
||||
if (length > this.leftBytes()) {
|
||||
// Something is wrong, revert
|
||||
this.offset = backupOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leftBytes() {
|
||||
return this.buffer.length - this.offset;
|
||||
}
|
||||
|
||||
checkByte(length) {
|
||||
const bytesAvailable = this.leftBytes();
|
||||
if (length > bytesAvailable) {
|
||||
throw new Error(
|
||||
"Not enough bytes left. Requested: " +
|
||||
length +
|
||||
" left: " +
|
||||
bytesAvailable,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
checkpoint() {
|
||||
this.savedOffset = this.offset;
|
||||
}
|
||||
|
||||
resetToCheckpoint() {
|
||||
this.offset = this.savedOffset;
|
||||
}
|
||||
}
|
||||
|
||||
export const TYPES = {
|
||||
VARINT: 0,
|
||||
FIXED64: 1,
|
||||
LENDELIM: 2,
|
||||
FIXED32: 5
|
||||
VARINT: 0,
|
||||
FIXED64: 1,
|
||||
LENDELIM: 2,
|
||||
FIXED32: 5,
|
||||
};
|
||||
|
||||
export function decodeProto(buffer) {
|
||||
const reader = new BufferReader(buffer);
|
||||
const parts = [];
|
||||
reader.trySkipGrpcHeader();
|
||||
const reader = new BufferReader(buffer);
|
||||
const parts = [];
|
||||
reader.trySkipGrpcHeader();
|
||||
|
||||
try {
|
||||
while (reader.leftBytes() > 0) {
|
||||
reader.checkpoint();
|
||||
try {
|
||||
while (reader.leftBytes() > 0) {
|
||||
reader.checkpoint();
|
||||
|
||||
const byteRange = [reader.offset];
|
||||
const indexType = parseInt(reader.readVarInt().toString());
|
||||
const type = indexType & 0b111;
|
||||
const index = indexType >> 3;
|
||||
const byteRange = [reader.offset];
|
||||
const indexType = parseInt(reader.readVarInt().toString());
|
||||
const type = indexType & 0b111;
|
||||
const index = indexType >> 3;
|
||||
|
||||
let value;
|
||||
if (type === TYPES.VARINT) {
|
||||
value = reader.readVarInt().toString();
|
||||
} else if (type === TYPES.LENDELIM) {
|
||||
const length = parseInt(reader.readVarInt().toString());
|
||||
value = reader.readBuffer(length);
|
||||
} else if (type === TYPES.FIXED32) {
|
||||
value = reader.readBuffer(4);
|
||||
} else if (type === TYPES.FIXED64) {
|
||||
value = reader.readBuffer(8);
|
||||
} else {
|
||||
throw new Error("Unknown type: " + type);
|
||||
}
|
||||
byteRange.push(reader.offset);
|
||||
let value;
|
||||
if (type === TYPES.VARINT) {
|
||||
value = reader.readVarInt().toString();
|
||||
} else if (type === TYPES.LENDELIM) {
|
||||
const length = parseInt(reader.readVarInt().toString());
|
||||
value = reader.readBuffer(length);
|
||||
} else if (type === TYPES.FIXED32) {
|
||||
value = reader.readBuffer(4);
|
||||
} else if (type === TYPES.FIXED64) {
|
||||
value = reader.readBuffer(8);
|
||||
} else {
|
||||
throw new Error("Unknown type: " + type);
|
||||
}
|
||||
byteRange.push(reader.offset);
|
||||
|
||||
parts.push({
|
||||
byteRange,
|
||||
index,
|
||||
type,
|
||||
value
|
||||
});
|
||||
parts.push({
|
||||
byteRange,
|
||||
index,
|
||||
type,
|
||||
value,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
reader.resetToCheckpoint();
|
||||
console.log(err);
|
||||
}
|
||||
} catch (err) {
|
||||
reader.resetToCheckpoint();
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
return {
|
||||
parts,
|
||||
leftOver: reader.readBuffer(reader.leftBytes())
|
||||
};
|
||||
return {
|
||||
parts,
|
||||
leftOver: reader.readBuffer(reader.leftBytes()),
|
||||
};
|
||||
}
|
||||
|
||||
export function typeToString(type, subType) {
|
||||
switch (type) {
|
||||
case TYPES.VARINT:
|
||||
return "varint";
|
||||
case TYPES.LENDELIM:
|
||||
return subType || "len_delim";
|
||||
case TYPES.FIXED32:
|
||||
return "fixed32";
|
||||
case TYPES.FIXED64:
|
||||
return "fixed64";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
switch (type) {
|
||||
case TYPES.VARINT:
|
||||
return "varint";
|
||||
case TYPES.LENDELIM:
|
||||
return subType || "len_delim";
|
||||
case TYPES.FIXED32:
|
||||
return "fixed32";
|
||||
case TYPES.FIXED64:
|
||||
return "fixed64";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
export function decodeVarint(buffer, offset) {
|
||||
let res = 0;
|
||||
let shift = 0;
|
||||
let byte = 0;
|
||||
let res = 0;
|
||||
let shift = 0;
|
||||
let byte = 0;
|
||||
|
||||
do {
|
||||
if (offset >= buffer.length) {
|
||||
throw new RangeError("Index out of bound decoding varint");
|
||||
}
|
||||
do {
|
||||
if (offset >= buffer.length) {
|
||||
throw new RangeError("Index out of bound decoding varint");
|
||||
}
|
||||
|
||||
byte = buffer[offset++];
|
||||
byte = buffer[offset++];
|
||||
|
||||
const multiplier = 2 ** shift;
|
||||
const thisByteValue = (byte & 0x7f) * multiplier;
|
||||
shift += 7;
|
||||
res = res + thisByteValue;
|
||||
} while (byte >= 0x80);
|
||||
const multiplier = 2 ** shift;
|
||||
const thisByteValue = (byte & 0x7f) * multiplier;
|
||||
shift += 7;
|
||||
res = res + thisByteValue;
|
||||
} while (byte >= 0x80);
|
||||
|
||||
return {
|
||||
value: res,
|
||||
length: shift / 7
|
||||
};
|
||||
return {
|
||||
value: res,
|
||||
length: shift / 7,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,53 +1,59 @@
|
||||
import { decode } from "./base32decoder.js";
|
||||
import jsSHA from "jssha";
|
||||
"use bigint"
|
||||
("use bigint");
|
||||
/**
|
||||
* get HOTP based on counter
|
||||
* @param {BigInt} counter BigInt counter of HOTP
|
||||
* @param {string} secret base32 encoded string
|
||||
* @param {string} secret base32 encoded string
|
||||
* @param {number} [digits=6] number of digits in OTP token
|
||||
* @param {string} [hashType='SHA-1'] type of hash (more in jsSHA documentation)
|
||||
* @returns HOTP string
|
||||
*/
|
||||
export function getHOTP(counter, secret, digits = 6, hashType = 'SHA-1'){
|
||||
|
||||
export function getHOTP(counter, secret, digits = 6, hashType = "SHA-1") {
|
||||
//Stage 1: Prepare data
|
||||
const rawDataCounter = new DataView(new ArrayBuffer(8))
|
||||
rawDataCounter.setUint32(4, counter)
|
||||
|
||||
const bCounter = new Uint8Array(rawDataCounter.buffer)
|
||||
const bSecret = new Uint8Array(decode(secret).match(/.{1,2}/g).map(chunk => parseInt(chunk, 16))); //confirmed
|
||||
|
||||
const rawDataCounter = new DataView(new ArrayBuffer(8));
|
||||
rawDataCounter.setUint32(4, counter);
|
||||
const bCounter = new Uint8Array(rawDataCounter.buffer);
|
||||
const bSecret = new Uint8Array(
|
||||
decode(secret)
|
||||
.match(/.{1,2}/g)
|
||||
.map((chunk) => parseInt(chunk, 16)),
|
||||
); //confirmed
|
||||
//Stage 2: Hash data
|
||||
const jssha = new jsSHA(hashType, 'UINT8ARRAY')
|
||||
jssha.setHMACKey(bSecret, 'UINT8ARRAY')
|
||||
jssha.update(bCounter)
|
||||
const hmacResult = jssha.getHMAC('UINT8ARRAY') //confirmed
|
||||
|
||||
const jssha = new jsSHA(hashType, "UINT8ARRAY");
|
||||
jssha.setHMACKey(bSecret, "UINT8ARRAY");
|
||||
jssha.update(bCounter);
|
||||
const hmacResult = jssha.getHMAC("UINT8ARRAY"); //confirmed
|
||||
//Stage 3: Dynamic truncate
|
||||
const offsetB = hmacResult[19] & 0xf;
|
||||
const P = hmacResult.slice(offsetB, offsetB + 4)
|
||||
const P = hmacResult.slice(offsetB, offsetB + 4);
|
||||
P[0] = P[0] & 0x7f;
|
||||
|
||||
//Stage 4: Format string
|
||||
let res = (new DataView(P.buffer).getInt32(0) % Math.pow(10, digits)).toString()
|
||||
while(res.length < digits)
|
||||
res = '0' + res;
|
||||
let res = (
|
||||
new DataView(P.buffer).getInt32(0) % Math.pow(10, digits)
|
||||
).toString();
|
||||
while (res.length < digits) res = "0" + res;
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* get OTP based on current time
|
||||
* @param {string} secret base32 encoded string
|
||||
* @param {string} secret base32 encoded string
|
||||
* @param {number} [digits=6] digits in OTP
|
||||
* @param {number} [time=Date.now()] time for counter (default unix time epoch)
|
||||
* @param {number} [fetchTime=30] period of token in seconds
|
||||
* @param {number} [timeOffset=0] time offset for token in seconds
|
||||
* @param {number} [timeOffset=0] time offset for token in seconds
|
||||
* @param {string} [hashType='SHA-1'] type of hash (more in jsSHA documentation)
|
||||
* @returns TOTP string
|
||||
*/
|
||||
export function getTOTP(secret, digits = 6, time = Date.now(), fetchTime = 30, timeOffset = 0, hashType = 'SHA-1')
|
||||
{
|
||||
const unixTime = Math.round((time / 1000 + timeOffset) / fetchTime)
|
||||
return getHOTP(BigInt(unixTime), secret, digits)
|
||||
}
|
||||
export function getTOTP(
|
||||
secret,
|
||||
digits = 6,
|
||||
time = Date.now(),
|
||||
fetchTime = 30,
|
||||
timeOffset = 0,
|
||||
hashType = "SHA-1",
|
||||
) {
|
||||
const unixTime = Math.round((time / 1000 + timeOffset) / fetchTime);
|
||||
return getHOTP(BigInt(unixTime), secret, digits);
|
||||
}
|
||||
|
||||
@@ -1,60 +1,62 @@
|
||||
export function decode(base32) {
|
||||
for (
|
||||
var base32chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
|
||||
bits = "",
|
||||
hex = "",
|
||||
i = 0;
|
||||
i < base32.length;
|
||||
i++
|
||||
) {
|
||||
var val = base32chars.indexOf(base32.charAt(i).toUpperCase());
|
||||
bits += leftpad(val.toString(2), 5, "0");
|
||||
}
|
||||
for (i = 0; i + 4 <= bits.length; i += 4) {
|
||||
var chunk = bits.substr(i, 4);
|
||||
hex += parseInt(chunk, 2).toString(16);
|
||||
}
|
||||
return hex;
|
||||
for (
|
||||
var base32chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
|
||||
bits = "",
|
||||
hex = "",
|
||||
i = 0;
|
||||
i < base32.length;
|
||||
i++
|
||||
) {
|
||||
var val = base32chars.indexOf(base32.charAt(i).toUpperCase());
|
||||
bits += leftpad(val.toString(2), 5, "0");
|
||||
}
|
||||
for (i = 0; i + 4 <= bits.length; i += 4) {
|
||||
var chunk = bits.substr(i, 4);
|
||||
hex += parseInt(chunk, 2).toString(16);
|
||||
}
|
||||
return hex;
|
||||
}
|
||||
|
||||
function leftpad(str, len, pad) {
|
||||
return (
|
||||
len + 1 >= str.length &&
|
||||
(str = new Array(len + 1 - str.length).join(pad) + str),
|
||||
str
|
||||
);
|
||||
return (
|
||||
len + 1 >= str.length &&
|
||||
(str = new Array(len + 1 - str.length).join(pad) + str),
|
||||
str
|
||||
);
|
||||
}
|
||||
|
||||
export function encode(bytes) {
|
||||
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
|
||||
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
||||
let bits = 0;
|
||||
let value = 0;
|
||||
let output = '';
|
||||
let output = "";
|
||||
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
value = (value << 8) | bytes[i];
|
||||
bits += 8;
|
||||
|
||||
while (bits >= 5) {
|
||||
output += alphabet[(value >>> (bits - 5)) & 0x1F];
|
||||
output += alphabet[(value >>> (bits - 5)) & 0x1f];
|
||||
bits -= 5;
|
||||
}
|
||||
}
|
||||
|
||||
if (bits > 0) {
|
||||
output += alphabet[(value << (5 - bits)) & 0x1F];
|
||||
output += alphabet[(value << (5 - bits)) & 0x1f];
|
||||
}
|
||||
|
||||
const paddingLength = (8 - (output.length % 8)) % 8;
|
||||
output += '='.repeat(paddingLength);
|
||||
output += "=".repeat(paddingLength);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
export function base64decode(base64) {
|
||||
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
const chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
let result = [];
|
||||
let i = 0, j = 0;
|
||||
let i = 0,
|
||||
j = 0;
|
||||
let b1, b2, b3, b4;
|
||||
|
||||
while (i < base64.length) {
|
||||
@@ -77,4 +79,4 @@ export function base64decode(base64) {
|
||||
}
|
||||
|
||||
return result.slice(0, j);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,60 +1,63 @@
|
||||
import { getHOTP } from "./OTPGenerator.js"
|
||||
import { getHOTP } from "./OTPGenerator.js";
|
||||
/**
|
||||
* TOTP instance
|
||||
*/
|
||||
export class TOTP {
|
||||
/**
|
||||
*
|
||||
* @param {string} secret base32 encoded string
|
||||
*
|
||||
* @param {string} secret base32 encoded string
|
||||
* @param {string} issuer issuer of TOTP
|
||||
* @param {string} client client of TOTP
|
||||
* @param {number} [digits=6] number of digits in OTP token
|
||||
* @param {number} [fetchTime=30] period of token in seconds
|
||||
* @param {number} [timeOffset=0] time offset for token in seconds
|
||||
* @param {number} [timeOffset=0] time offset for token in seconds
|
||||
* @param {string} [hashType='SHA-1'] type of hash (more in jsSHA documentation)
|
||||
*/
|
||||
constructor(secret,
|
||||
constructor(
|
||||
secret,
|
||||
issuer,
|
||||
client,
|
||||
digits = 6,
|
||||
fetchTime = 30,
|
||||
timeOffset = 0,
|
||||
hashType = 'SHA-1') {
|
||||
this.secret = secret
|
||||
this.issuer = issuer
|
||||
this.client = client
|
||||
this.digits = digits
|
||||
this.fetchTime = fetchTime
|
||||
this.timeOffset = timeOffset
|
||||
this.hashType = hashType
|
||||
hashType = "SHA-1",
|
||||
) {
|
||||
this.secret = secret;
|
||||
this.issuer = issuer;
|
||||
this.client = client;
|
||||
this.digits = digits;
|
||||
this.fetchTime = fetchTime;
|
||||
this.timeOffset = timeOffset;
|
||||
this.hashType = hashType;
|
||||
}
|
||||
static copy(totp){
|
||||
static copy(totp) {
|
||||
return new TOTP(
|
||||
secret = totp.secret,
|
||||
issuer = totp.TOTPissuer,
|
||||
client = totp.client,
|
||||
digits = totp.digits,
|
||||
fetchTime = totp.fetchTime,
|
||||
timeOffset = totp.timeOffset,
|
||||
hashType = totp.hashType
|
||||
)
|
||||
(secret = totp.secret),
|
||||
(issuer = totp.TOTPissuer),
|
||||
(client = totp.client),
|
||||
(digits = totp.digits),
|
||||
(fetchTime = totp.fetchTime),
|
||||
(timeOffset = totp.timeOffset),
|
||||
(hashType = totp.hashType),
|
||||
);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {number} time time for counter (default unix time epoch)
|
||||
* @returns OTP instance
|
||||
*/
|
||||
getOTP(time = Date.now()) {
|
||||
const unixTime = (time / 1000 + this.timeOffset) / this.fetchTime
|
||||
const otp = getHOTP(Math.floor(unixTime), this.secret, this.digits)
|
||||
const expireTime = time +
|
||||
const unixTime = (time / 1000 + this.timeOffset) / this.fetchTime;
|
||||
const otp = getHOTP(Math.floor(unixTime), this.secret, this.digits);
|
||||
const expireTime =
|
||||
time +
|
||||
(this.fetchTime -
|
||||
(time / 1000 + this.timeOffset) %
|
||||
this.fetchTime) * 1000
|
||||
const createdTime = time - (((time / 1000 + this.timeOffset) %
|
||||
this.fetchTime) * 1000)
|
||||
|
||||
return new OTP(otp, createdTime, expireTime)
|
||||
((time / 1000 + this.timeOffset) % this.fetchTime)) *
|
||||
1000;
|
||||
const createdTime =
|
||||
time - ((time / 1000 + this.timeOffset) % this.fetchTime) * 1000;
|
||||
|
||||
return new OTP(otp, createdTime, expireTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,14 +66,14 @@ export class TOTP {
|
||||
*/
|
||||
export class OTP {
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {string} otp OTP string
|
||||
* @param {number} createdTime time in unix epoch created OTP
|
||||
* @param {number} expireTime time in unix epoch to expire OTP
|
||||
* @param {number} createdTime time in unix epoch created OTP
|
||||
* @param {number} expireTime time in unix epoch to expire OTP
|
||||
*/
|
||||
constructor(otp, createdTime, expireTime) {
|
||||
this.otp = otp
|
||||
this.createdTime = createdTime
|
||||
this.expireTime = expireTime
|
||||
this.otp = otp;
|
||||
this.createdTime = createdTime;
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user