Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the epoch Parameter #2

Open
ingk opened this issue Sep 3, 2019 · 1 comment
Open

Using the epoch Parameter #2

ingk opened this issue Sep 3, 2019 · 1 comment

Comments

@ingk
Copy link

ingk commented Sep 3, 2019

Hello @olsio and thanks for creating otp-client!

In index.test.js you're passing epoch as an option:

const epoch = new Date('Mon, 25 Dec 1995 12:00:15 UTC').getTime()
const otp = new OTP(secret, { epoch })

I was wondering if you consider the epoch parameter as public API. Especially for writing tests in an application it's really helpful to create a token in a specific point in time. Otherwise it's only possible to test for an expected output format.
Unfortunately this parameter is not documented. By it's name and the code example I imply it to be Unix time in milliseconds.
Would you consider adding this part to the documentation or accepting pull requests for it?

@olsio
Copy link
Owner

olsio commented Sep 3, 2019

Sure just send me a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants