adminforth 1.1.78 → 1.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/dist/modules/codeInjector.js +51 -23
  2. package/dist/plugins/AuditLog/index.js +13 -0
  3. package/dist/plugins/AuditLog/types.js +1 -0
  4. package/dist/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  5. package/dist/spa/index.html +1 -1
  6. package/dist/spa/package-lock.json +0 -111
  7. package/dist/spa/package.json +0 -1
  8. package/dist/spa/src/App.vue +133 -178
  9. package/dist/spa/src/components/MenuLink.vue +3 -3
  10. package/dist/spa/src/components/ResourceForm.vue +96 -96
  11. package/dist/spa/src/components/ResourceListTable.vue +84 -69
  12. package/dist/spa/src/components/ValueRenderer.vue +3 -2
  13. package/dist/spa/src/composables/useStores.ts +11 -24
  14. package/dist/spa/src/main.ts +1 -1
  15. package/dist/spa/src/router/index.ts +1 -0
  16. package/dist/spa/src/utils.ts +1 -1
  17. package/dist/spa/src/views/CreateView.vue +9 -1
  18. package/dist/spa/src/views/EditView.vue +9 -1
  19. package/dist/spa/src/views/ListView.vue +3 -12
  20. package/dist/spa/src/views/LoginView.vue +1 -6
  21. package/dist/spa/src/views/ResourceParent.vue +2 -1
  22. package/dist/spa/src/views/ShowView.vue +14 -6
  23. package/dist/spa/tailwind.config.js +1 -3
  24. package/modules/codeInjector.ts +56 -26
  25. package/package.json +1 -1
  26. package/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  27. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  28. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  29. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  30. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  31. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  32. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  33. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  34. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  35. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  36. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  37. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  38. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  39. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  40. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  41. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  42. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  43. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  44. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  45. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  46. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  47. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  48. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  49. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  50. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  51. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  52. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  53. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  54. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  55. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  56. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  57. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  58. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  59. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  60. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  61. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  62. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  63. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  64. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  65. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  66. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  67. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  68. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  69. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  70. package/dist/spa/src/components/SkeleteLoader.vue +0 -23
  71. package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  72. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  73. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  74. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +0 -8
  75. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +0 -1040
  76. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +0 -541
  77. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +0 -2363
  78. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +0 -1544
  79. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +0 -578
  80. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +0 -452
  81. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +0 -19
  82. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +0 -4523
  83. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +0 -596
  84. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  85. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +0 -476
  86. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +0 -864
  87. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +0 -124
  88. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +0 -170
  89. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +0 -931
  90. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +0 -1245
  91. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +0 -4317
  92. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +0 -412
  93. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +0 -1
  94. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +0 -1908
  95. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +0 -2418
  96. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +0 -550
  97. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +0 -89
  98. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +0 -2746
  99. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +0 -315
  100. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +0 -999
  101. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +0 -495
  102. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  103. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +0 -191
  104. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +0 -905
  105. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +0 -1754
  106. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +0 -117
  107. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +0 -153
  108. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +0 -150
  109. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +0 -540
  110. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +0 -430
  111. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +0 -153
  112. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +0 -12
  113. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +0 -83
  114. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +0 -367
  115. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +0 -1707
  116. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +0 -67
  117. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +0 -1718
  118. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +0 -97
  119. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +0 -240
  120. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +0 -1217
  121. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +0 -197
  122. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +0 -208
  123. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +0 -952
  124. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +0 -2292
  125. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +0 -808
  126. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +0 -924
  127. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +0 -181
  128. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +0 -694
  129. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +0 -530
  130. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  131. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  132. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +0 -127
  133. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  134. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  135. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  136. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +0 -11
  137. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  138. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +0 -4
  139. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  140. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  141. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  142. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  143. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  144. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  145. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  146. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  147. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  148. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  149. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  150. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  151. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  152. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  153. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  154. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  155. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  156. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  157. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  158. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  159. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  160. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  161. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  162. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +0 -37
  163. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  164. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  165. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  166. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +0 -453
  167. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  168. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  169. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  170. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  171. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  172. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  173. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +0 -31
  174. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +0 -43
  175. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +0 -18
  176. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +0 -36
  177. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +0 -97
  178. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +0 -34
  179. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +0 -21
  180. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +0 -28
  181. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  182. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +0 -241
  183. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +0 -128
  184. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +0 -209
  185. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +0 -39
  186. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +0 -54
  187. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +0 -108
  188. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  189. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +0 -7
  190. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +0 -9
  191. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +0 -4
  192. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +0 -63
  193. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +0 -5
  194. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +0 -50
  195. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +0 -25
  196. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +0 -12
  197. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  198. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +0 -25
  199. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  200. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +0 -71
  201. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +0 -19
  202. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +0 -28
  203. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +0 -30
  204. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +0 -61
  205. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +0 -220
  206. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/websocket.d.ts +0 -131
@@ -1,21 +0,0 @@
1
- {
2
- "name": "@types/notp",
3
- "version": "2.0.5",
4
- "description": "TypeScript definitions for notp",
5
- "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/notp",
6
- "license": "MIT",
7
- "contributors": [],
8
- "main": "",
9
- "types": "index.d.ts",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
13
- "directory": "types/notp"
14
- },
15
- "scripts": {},
16
- "dependencies": {
17
- "@types/node": "*"
18
- },
19
- "typesPublisherContentHash": "746a99309c6f17d73e0a9d112b03297e4ec2e2fc6da3d58132842784ae813fd8",
20
- "typeScriptVersion": "4.5"
21
- }
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "{}"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright {yyyy} {name of copyright owner}
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,68 +0,0 @@
1
- # node-2fa
2
-
3
- Easy 2-Factor Integration For Node.js
4
-
5
- There are a number of applications which support 2-Factor Authentication, namely
6
-
7
- - Authy [iPhone](https://itunes.apple.com/us/app/authy/id494168017?mt=8) | [Android](https://play.google.com/store/apps/details?id=com.authy.authy&hl=en) | [Chrome](https://chrome.google.com/webstore/detail/authy/gaedmjdfmmahhbjefcbgaolhhanlaolb?hl=en) | [Linux](https://www.authy.com/personal/) | [OS X](https://www.authy.com/personal/) | [BlackBerry](https://appworld.blackberry.com/webstore/content/38831914/?countrycode=US&lang=en)
8
- - Google Authenticator [iPhone](https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8) | [Android](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en)
9
- - Microsoft Authenticator [Windows Phone](https://www.microsoft.com/en-us/store/apps/authenticator/9wzdncrfj3rj) | [Android](https://play.google.com/store/apps/details?id=com.microsoft.msa.authenticator)
10
-
11
- This module uses [`notp`](https://github.com/guyht/notp) which implements `TOTP` [(RFC 6238)](https://www.ietf.org/rfc/rfc6238.txt)
12
- (the _Authenticator_ standard), which is based on `HOTP` [(RFC 4226)](https://www.ietf.org/rfc/rfc4226.txt)
13
- to provide codes that are exactly compatible with all other _Authenticator_ apps and services that use them.
14
-
15
- Usage
16
- =====
17
-
18
- ```bash
19
- npm install node-2fa --save
20
- ```
21
-
22
- ```javascript
23
- const twofactor = require("node-2fa");
24
-
25
- const newSecret = twofactor.generateSecret({ name: "My Awesome App", account: "johndoe" });
26
- /*
27
- { secret: 'XDQXYCP5AC6FA32FQXDGJSPBIDYNKK5W',
28
- uri: 'otpauth://totp/My%20Awesome%20App:johndoe?secret=XDQXYCP5AC6FA32FQXDGJSPBIDYNKK5W&issuer=My%20Awesome%20App',
29
- qr: 'https://chart.googleapis.com/chart?chs=166x166&chld=L|0&cht=qr&chl=otpauth://totp/My%20Awesome%20App:johndoe%3Fsecret=XDQXYCP5AC6FA32FQXDGJSPBIDYNKK5W%26issuer=My%20Awesome%20App'
30
- }
31
- */
32
-
33
- const newToken = twofactor.generateToken("XDQXYCP5AC6FA32FQXDGJSPBIDYNKK5W");
34
- // => { token: '630618' }
35
-
36
- twofactor.verifyToken("XDQXYCP5AC6FA32FQXDGJSPBIDYNKK5W", "630618");
37
- // => { delta: 0 }
38
-
39
- twofactor.verifyToken("XDQXYCP5AC6FA32FQXDGJSPBIDYNKK5W", "00");
40
- // => null
41
- ```
42
-
43
- ## API
44
-
45
- ### generateSecret(options)
46
-
47
- returns an object containing a 32-character secret (keep user specific, store in DB), a uri (if you want to make your own QR / barcode) and a direct link to a QR code served via HTTPS by the Google Chart API
48
-
49
- options is an object containing `name` which is the name of your app that will show up when the user scans the QR code and `account` which can be the username and will also show up in the user's app. Both parameters are optional
50
-
51
- ### generateToken(secret)
52
-
53
- returns an object containing a 6-character token
54
-
55
- ### verifyToken(secret, token, window)
56
-
57
- checks if a time-based token matches a token from secret key within a +/- _window_ (default: 4) minute window
58
-
59
- returns either `null` if the token does not match, or an object containing delta key, which is an integer of how for behind / forward the code time sync is in terms of how many new codes have been generated since entry
60
-
61
- ex.
62
- `{delta: -1}` means that the client entered the key too late (a newer key was meant to be used).
63
- `{delta: 1}` means the client entered the key too early (an older key was meant to be used).
64
- `{delta: 0}` means the client was within the time frame of the current key.
65
-
66
- ## _n_-Minute Window
67
-
68
- The window is set to 4 by default. Each token is valid for a total of _n_ minutes to account for time drift.
@@ -1,11 +0,0 @@
1
- import notp from "notp";
2
- import { Options } from "./interfaces";
3
- export declare function generateSecret(options?: Options): {
4
- secret: string;
5
- uri: string;
6
- qr: string;
7
- };
8
- export declare function generateToken(secret: string): {
9
- token: string;
10
- } | null;
11
- export declare function verifyToken(secret: string, token?: string, window?: number): notp.VerifyResult | null;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyToken = exports.generateToken = exports.generateSecret = void 0;
4
- const tslib_1 = require("tslib");
5
- const notp_1 = tslib_1.__importDefault(require("notp"));
6
- const crypto_1 = tslib_1.__importDefault(require("crypto"));
7
- const thirty_two_1 = tslib_1.__importDefault(require("thirty-two"));
8
- function generateSecret(options) {
9
- var _a;
10
- const config = {
11
- name: encodeURIComponent((_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : "App"),
12
- account: encodeURIComponent((options === null || options === void 0 ? void 0 : options.account) ? `:${options.account}` : ""),
13
- };
14
- const bin = crypto_1.default.randomBytes(20);
15
- const base32 = thirty_two_1.default.encode(bin).toString("utf8").replace(/=/g, "");
16
- const secret = base32
17
- .toLowerCase()
18
- .replace(/(\w{4})/g, "$1 ")
19
- .trim()
20
- .split(" ")
21
- .join("")
22
- .toUpperCase();
23
- const query = `?secret=${secret}&issuer=${config.name}`;
24
- const encodedQuery = query.replace('?', '%3F').replace('&', '%26');
25
- const uri = `otpauth://totp/${config.name}${config.account}`;
26
- return {
27
- secret,
28
- uri: `${uri}${query}`,
29
- qr: `https://chart.googleapis.com/chart?chs=166x166&chld=L|0&cht=qr&chl=${uri}${encodedQuery}`
30
- };
31
- }
32
- exports.generateSecret = generateSecret;
33
- function generateToken(secret) {
34
- if (!secret || !secret.length)
35
- return null;
36
- const unformatted = secret.replace(/\W+/g, "").toUpperCase();
37
- const bin = thirty_two_1.default.decode(unformatted);
38
- return { token: notp_1.default.totp.gen(bin) };
39
- }
40
- exports.generateToken = generateToken;
41
- function verifyToken(secret, token, window = 4) {
42
- if (!token || !token.length)
43
- return null;
44
- const unformatted = secret.replace(/\W+/g, "").toUpperCase();
45
- const bin = thirty_two_1.default.decode(unformatted);
46
- return notp_1.default.totp.verify(token.replace(/\W+/g, ""), bin, {
47
- window,
48
- time: 30,
49
- });
50
- }
51
- exports.verifyToken = verifyToken;
@@ -1,4 +0,0 @@
1
- export interface Options {
2
- name: string;
3
- account: string;
4
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,58 +0,0 @@
1
- {
2
- "name": "node-2fa",
3
- "version": "2.0.3",
4
- "description": "Easy 2-Factor Integration For Node.js",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "private": false,
8
- "scripts": {
9
- "test": "eslint . --fix&&jest",
10
- "prepublishOnly": "npm run test&&npm run build",
11
- "build": "tsc"
12
- },
13
- "files": [
14
- "dist",
15
- "package.json",
16
- "readme.md"
17
- ],
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/jeremyscalpello/node-2fa"
21
- },
22
- "keywords": [
23
- "auth",
24
- "2fa",
25
- "mfa",
26
- "token",
27
- "key",
28
- "base32",
29
- "code",
30
- "generator"
31
- ],
32
- "contributors": [
33
- "Jeremy Scalpello <jeremy@scalpello.info>",
34
- "Alistair Smith <hey@alistair.cloud>"
35
- ],
36
- "license": "Apache-2.0",
37
- "homepage": "https://github.com/jeremyscalpello/node-2fa#readme",
38
- "dependencies": {
39
- "@types/notp": "^2.0.0",
40
- "notp": "^2.0.3",
41
- "thirty-two": "1.0.2",
42
- "tslib": "^2.1.0"
43
- },
44
- "devDependencies": {
45
- "@types/jest": "^26.0.20",
46
- "@types/node": "^14.14.20",
47
- "@typescript-eslint/eslint-plugin": "^4.12.0",
48
- "@typescript-eslint/parser": "^4.12.0",
49
- "eslint": "^7.17.0",
50
- "jest": "^26.6.3",
51
- "prettier": "^2.2.1",
52
- "ts-jest": "^26.4.4",
53
- "typescript": "^4.1.3"
54
- },
55
- "prettier": {
56
- "printWidth": 120
57
- }
58
- }
@@ -1,6 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - "0.6"
4
- - "0.8"
5
- - "0.10"
6
- - "0.11"
@@ -1,22 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2011 Guy Halford-Thompson <guy@cach.me>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- 'Software'), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,135 +0,0 @@
1
- [![Build Status](https://travis-ci.org/guyht/notp.svg)](https://travis-ci.org/guyht/notp)
2
-
3
- # Node One Time Password library
4
- Simple to use, fast, and with zero dependencies. The Node One Time Password library is fully compliant with [HOTP](http://tools.ietf.org/html/rfc4226) (counter based one time passwords) and [TOTP](http://tools.ietf.org/html/rfc6238) (time based one time passwords). It can be used in conjunction with the [Google Authenticator](http://code.google.com/p/google-authenticator/) which has free apps for iOS, Android and BlackBerry.
5
-
6
- # Installation
7
-
8
- ```
9
- npm install notp
10
- ```
11
-
12
- # Usage
13
-
14
- ```javascript
15
- var notp = require('notp');
16
-
17
- //.... some initial login code, that receives the user details and TOTP / HOTP token
18
-
19
- var key = 'secret key for user... could be stored in DB';
20
- var token = 'user supplied one time use token';
21
-
22
- // Check TOTP is correct (HOTP if hotp pass type)
23
- var login = notp.totp.verify(token, key);
24
-
25
- // invalid token if login is null
26
- if (!login) {
27
- return console.log('Token invalid');
28
- }
29
-
30
- // valid token
31
- console.log('Token valid, sync value is %s', login.delta);
32
- ```
33
-
34
- ## Google Authenticator
35
-
36
- [Google authenticator](https://code.google.com/p/google-authenticator/) requires that keys be base32 encoded before being used. This includes manual entry into the app as well as preparing a QR code URI.
37
-
38
- To base32 encode a utf8 key you can use the `thirty-two` module.
39
-
40
- ```javascript
41
- var base32 = require('thirty-two');
42
-
43
- var key = 'secret key for the user';
44
-
45
- // encoded will be the secret key, base32 encoded
46
- var encoded = base32.encode(key);
47
-
48
- // Google authenticator doesn't like equal signs
49
- var encodedForGoogle = encoded.toString().replace(/=/g,'');
50
-
51
- // to create a URI for a qr code (change totp to hotp is using hotp)
52
- var uri = 'otpauth://totp/somelabel?secret=' + encodedForGoogle;
53
- ```
54
-
55
- Note: If your label has spaces or other invalid uri characters you will need to encode it accordingly using `encodeURIComponent` More details about the uri key format can be found on the [google auth wiki](https://code.google.com/p/google-authenticator/wiki/KeyUriFormat)
56
-
57
- # API
58
- ##hotp.verify(token, key, opt)
59
-
60
- Check a counter based one time password for validity.
61
-
62
- Returns null if token is not valid for given key and options.
63
-
64
- Returns an object `{delta: #}` if the token is valid. `delta` is the count skew between client and server.
65
-
66
- ### opt
67
- **window**
68
- > The allowable margin for the counter. The function will check `window` codes in the future against the provided token.
69
- > i.e. if `window = 100` and `counter = 5` all tokens between 5 and 105 will be checked against the supplied token
70
- > Default - 50
71
-
72
- **counter**
73
- > Counter value. This should be stored by the application on a per user basis. It is up to the application to track and increment this value as needed. It is also up to the application to increment this value if there is a skew between the client and server (`delta`)
74
-
75
- ##totp.verify(token, key, opt)
76
-
77
- Check a time based one time password for validity
78
-
79
- Returns null if token is not valid for given key and options.
80
-
81
- Returns an object `{delta: #}` if the token is valid. `delta` is the count skew between client and server.
82
-
83
- ### opt
84
- **window**
85
- > The allowable margin for the counter. The function will check `window` codes in the future against the provided token.
86
- > i.e. if `window = 5` and `counter = 1000` all tokens between 995 and 1005 will be checked against the supplied token
87
- > Default - 6
88
-
89
- **time**
90
- > The time step of the counter. This must be the same for every request and is used to calculate C.
91
- > Default - 30
92
-
93
- ##hotp.gen(key, opt)
94
-
95
- Return a counter based one time password
96
-
97
- ### opt
98
- **counter**
99
- > Counter value. This should be stored by the application, must be user specific, and be incremented for each request.
100
-
101
- ##totp.gen(key, opt)
102
-
103
- Return a time based one time password
104
-
105
- ### opt
106
- **time**
107
- > The time step of the counter. This must be the same for every request and is used to calculate C.
108
- > Default - 30
109
-
110
- # Migrating from 1.x to 2.x
111
-
112
- ## Removed
113
- The `encBase32` and `decBase32` methods have been removed. If you wish to encode/decode base32 you should install a module to do so. We recommend the `thirty-two` npm module.
114
-
115
- ## Changed
116
-
117
- All of the APIs have been changed to return values directly instead of using callbacks. This reflects the fact that the functions are actually synchronous and perform no I/O.
118
-
119
- Some of the required arguments to the functions have also been removed from the `args` parameter and are passed as separate function parameters. See the above API docs for details.
120
-
121
- * `notp.checkHOTP(args, err, cb)` -> `notp.hotp.verify(token, key, opt)`
122
- * `notp.checkTOTP(args, err, cb)` -> `notp.totp.verify(token, key, opt)`
123
- * `notp.getHOTP(args, err, cb)` -> `notp.gotp.gen(key, opt)`
124
- * `notp.getTOTP(args, err, cb)` -> `notp.totp.gen(key, opt)`
125
-
126
- ## Args
127
-
128
- The argument names have also changed to better describe the purpose of the argument.
129
-
130
- * `K` -> no longer in args/opt but passed directly as a function argument
131
- * `P` -> no longer in args/opt but passed directly as a function argument
132
- * `W` -> `window`
133
- * `C` -> `counter`
134
- * `T` -> `time`
135
-
@@ -1,33 +0,0 @@
1
-
2
- var notp = require('../index'),
3
- t2 = require('thirty-two'),
4
- K = '12345678901234567890',
5
- b32 = t2.encode(K);
6
-
7
- console.log('Click on this link to gennerate a QR code, and use Google Authenticator on your phone to read it:');
8
- console.log('http://qrcode.kaywa.com/img.php?s=8&d=' + encodeURIComponent('otpauth://totp/notp@example.com?secret=' + b32));
9
- verify();
10
-
11
- function verify() {
12
- ask('Enter a code to verify', function(code) {
13
- if(notp.totp.verify(code, K, {})) {
14
- console.log('Success!!!');
15
- }
16
- console.log(notp.totp.verify(code, K, {}));
17
- verify();
18
- });
19
- }
20
-
21
-
22
-
23
- function ask(question, callback) {
24
- var stdin = process.stdin, stdout = process.stdout;
25
-
26
- stdin.resume();
27
- stdout.write(question + ": ");
28
-
29
- stdin.once('data', function(data) {
30
- data = data.toString().trim();
31
- callback(data);
32
- });
33
- }
@@ -1,15 +0,0 @@
1
-
2
- var notp = require('../index'),
3
- t2 = require('thirty-two'),
4
- K = '12345678901234567890',
5
- b32 = t2.encode(K);
6
-
7
- console.log('Getting current counter value for K = 12345678901234567890');
8
- console.log('This has a base32 value of ' + b32);
9
- console.log('The base32 value should be entered in the Google Authenticator App');
10
- console.log('');
11
- console.log('Open the following URL for a QR code. Google Authenticator can read this QR code using your phone\'s camera:');
12
- console.log('http://qrcode.kaywa.com/img.php?s=8&d=' + encodeURIComponent('otpauth://totp/notp@example.com?secret=' + b32));
13
-
14
- console.log('The current TOTP value is ' + notp.totp.gen(K, {}));
15
-