Skip to content

Commit

Permalink
Don't check for NODE_ENV
Browse files Browse the repository at this point in the history
As discussed in guyht#29 there is no advantage to disallowing the manipulation of `opt._t` in any case where a client has arbitrary access to `opt.window`.
  • Loading branch information
AJ ONeal committed Oct 7, 2015
1 parent f98cbb8 commit 070c777
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ totp.gen = function(key, opt) {

// Time has been overwritten.
if(opt._t) {
if(process.env.NODE_ENV != 'test') {
throw new Error('cannot overwrite time in non-test environment!');
}
_t = opt._t;
}

Expand Down Expand Up @@ -174,9 +171,6 @@ totp.verify = function(token, key, opt) {

// Time has been overwritten.
if(opt._t) {
if(process.env.NODE_ENV != 'test') {
throw new Error('cannot overwrite time in non-test environment!');
}
_t = opt._t;
}

Expand Down

0 comments on commit 070c777

Please sign in to comment.