Skip to content

Commit fe4c693

Browse files
feat: add totp login API (#416)
* fix: * removed hasReversedValue in playground * feat: * added totp methods in db's providers * adding totp in login method * feat: * added toggle in dashboard * fixing issue with env set * feat: * integrated totp * feat: * encrypted userid * added totp_verified column in user table * started test for totp * feat: * test cases totp * test-cases: * completed test cases * tested for all dbs * fixes: * return variable to snake case * import refactoring * feat: * created seperate folder for authenticator with totp subfolder * refactored code * created new table for authenticators * added recovery code for totp * feat: * adding functions to different db providers * feat: * added authenticators method for all db * feat: * added logic for updating mfa in user_profile update * fix: * merge conflict * fix: * resolved mongodb, dynamodb and arangodb test case bug * added new condition for checking first time totp user or not * feat: * changes in all respective db with authenticator * fix: * PR suggested changes * fix(cassandra): list users * Update verify otp * fix totp login api --------- Co-authored-by: lemonScaletech <[email protected]>
1 parent d8cd965 commit fe4c693

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4336
-1126
lines changed

app/package-lock.json

Lines changed: 451 additions & 231 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/yarn.lock

Lines changed: 115 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,23 @@
1616
dependencies:
1717
"@authorizerdev/authorizer-js" "^1.2.6"
1818

19-
"@babel/code-frame@^7.16.7":
20-
version "7.16.7"
21-
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz"
22-
integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==
23-
dependencies:
24-
"@babel/highlight" "^7.16.7"
25-
26-
"@babel/generator@^7.16.8":
27-
version "7.16.8"
28-
resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz"
29-
integrity sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==
30-
dependencies:
31-
"@babel/types" "^7.16.8"
19+
"@babel/code-frame@^7.22.13":
20+
version "7.22.13"
21+
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz"
22+
integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==
23+
dependencies:
24+
"@babel/highlight" "^7.22.13"
25+
chalk "^2.4.2"
26+
27+
"@babel/generator@^7.23.0":
28+
version "7.23.0"
29+
resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz"
30+
integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==
31+
dependencies:
32+
"@babel/types" "^7.23.0"
33+
"@jridgewell/gen-mapping" "^0.3.2"
34+
"@jridgewell/trace-mapping" "^0.3.17"
3235
jsesc "^2.5.1"
33-
source-map "^0.5.0"
3436

3537
"@babel/helper-annotate-as-pure@^7.16.0":
3638
version "7.16.7"
@@ -39,35 +41,25 @@
3941
dependencies:
4042
"@babel/types" "^7.16.7"
4143

42-
"@babel/helper-environment-visitor@^7.16.7":
43-
version "7.16.7"
44-
resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz"
45-
integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==
46-
dependencies:
47-
"@babel/types" "^7.16.7"
44+
"@babel/helper-environment-visitor@^7.22.20":
45+
version "7.22.20"
46+
resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz"
47+
integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==
4848

49-
"@babel/helper-function-name@^7.16.7":
50-
version "7.16.7"
51-
resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz"
52-
integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==
49+
"@babel/helper-function-name@^7.23.0":
50+
version "7.23.0"
51+
resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz"
52+
integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==
5353
dependencies:
54-
"@babel/helper-get-function-arity" "^7.16.7"
55-
"@babel/template" "^7.16.7"
56-
"@babel/types" "^7.16.7"
54+
"@babel/template" "^7.22.15"
55+
"@babel/types" "^7.23.0"
5756

58-
"@babel/helper-get-function-arity@^7.16.7":
59-
version "7.16.7"
60-
resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz"
61-
integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==
57+
"@babel/helper-hoist-variables@^7.22.5":
58+
version "7.22.5"
59+
resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz"
60+
integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==
6261
dependencies:
63-
"@babel/types" "^7.16.7"
64-
65-
"@babel/helper-hoist-variables@^7.16.7":
66-
version "7.16.7"
67-
resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz"
68-
integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==
69-
dependencies:
70-
"@babel/types" "^7.16.7"
62+
"@babel/types" "^7.22.5"
7163

7264
"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.16.0":
7365
version "7.16.7"
@@ -76,31 +68,36 @@
7668
dependencies:
7769
"@babel/types" "^7.16.7"
7870

79-
"@babel/helper-split-export-declaration@^7.16.7":
80-
version "7.16.7"
81-
resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz"
82-
integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==
71+
"@babel/helper-split-export-declaration@^7.22.6":
72+
version "7.22.6"
73+
resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz"
74+
integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==
8375
dependencies:
84-
"@babel/types" "^7.16.7"
76+
"@babel/types" "^7.22.5"
8577

86-
"@babel/helper-validator-identifier@^7.16.7":
87-
version "7.16.7"
88-
resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz"
89-
integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==
78+
"@babel/helper-string-parser@^7.22.5":
79+
version "7.22.5"
80+
resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz"
81+
integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==
82+
83+
"@babel/helper-validator-identifier@^7.22.20":
84+
version "7.22.20"
85+
resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz"
86+
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==
9087

91-
"@babel/highlight@^7.16.7":
92-
version "7.16.10"
93-
resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz"
94-
integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==
88+
"@babel/highlight@^7.22.13":
89+
version "7.22.20"
90+
resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz"
91+
integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==
9592
dependencies:
96-
"@babel/helper-validator-identifier" "^7.16.7"
97-
chalk "^2.0.0"
93+
"@babel/helper-validator-identifier" "^7.22.20"
94+
chalk "^2.4.2"
9895
js-tokens "^4.0.0"
9996

100-
"@babel/parser@^7.16.10", "@babel/parser@^7.16.7":
101-
version "7.16.12"
102-
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz"
103-
integrity sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==
97+
"@babel/parser@^7.22.15", "@babel/parser@^7.23.0":
98+
version "7.23.0"
99+
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz"
100+
integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==
104101

105102
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1":
106103
version "7.14.8"
@@ -109,37 +106,38 @@
109106
dependencies:
110107
regenerator-runtime "^0.13.4"
111108

112-
"@babel/template@^7.16.7":
113-
version "7.16.7"
114-
resolved "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz"
115-
integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==
109+
"@babel/template@^7.22.15":
110+
version "7.22.15"
111+
resolved "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz"
112+
integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==
116113
dependencies:
117-
"@babel/code-frame" "^7.16.7"
118-
"@babel/parser" "^7.16.7"
119-
"@babel/types" "^7.16.7"
114+
"@babel/code-frame" "^7.22.13"
115+
"@babel/parser" "^7.22.15"
116+
"@babel/types" "^7.22.15"
120117

121118
"@babel/traverse@^7.4.5":
122-
version "7.16.10"
123-
resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz"
124-
integrity sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==
125-
dependencies:
126-
"@babel/code-frame" "^7.16.7"
127-
"@babel/generator" "^7.16.8"
128-
"@babel/helper-environment-visitor" "^7.16.7"
129-
"@babel/helper-function-name" "^7.16.7"
130-
"@babel/helper-hoist-variables" "^7.16.7"
131-
"@babel/helper-split-export-declaration" "^7.16.7"
132-
"@babel/parser" "^7.16.10"
133-
"@babel/types" "^7.16.8"
119+
version "7.23.2"
120+
resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz"
121+
integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==
122+
dependencies:
123+
"@babel/code-frame" "^7.22.13"
124+
"@babel/generator" "^7.23.0"
125+
"@babel/helper-environment-visitor" "^7.22.20"
126+
"@babel/helper-function-name" "^7.23.0"
127+
"@babel/helper-hoist-variables" "^7.22.5"
128+
"@babel/helper-split-export-declaration" "^7.22.6"
129+
"@babel/parser" "^7.23.0"
130+
"@babel/types" "^7.23.0"
134131
debug "^4.1.0"
135132
globals "^11.1.0"
136133

137-
"@babel/types@^7.16.7", "@babel/types@^7.16.8":
138-
version "7.16.8"
139-
resolved "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz"
140-
integrity sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==
134+
"@babel/types@^7.16.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0":
135+
version "7.23.0"
136+
resolved "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz"
137+
integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==
141138
dependencies:
142-
"@babel/helper-validator-identifier" "^7.16.7"
139+
"@babel/helper-string-parser" "^7.22.5"
140+
"@babel/helper-validator-identifier" "^7.22.20"
143141
to-fast-properties "^2.0.0"
144142

145143
"@emotion/is-prop-valid@^0.8.8":
@@ -164,6 +162,38 @@
164162
resolved "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz"
165163
integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==
166164

165+
"@jridgewell/gen-mapping@^0.3.2":
166+
version "0.3.3"
167+
resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz"
168+
integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==
169+
dependencies:
170+
"@jridgewell/set-array" "^1.0.1"
171+
"@jridgewell/sourcemap-codec" "^1.4.10"
172+
"@jridgewell/trace-mapping" "^0.3.9"
173+
174+
"@jridgewell/resolve-uri@^3.1.0":
175+
version "3.1.1"
176+
resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz"
177+
integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==
178+
179+
"@jridgewell/set-array@^1.0.1":
180+
version "1.1.2"
181+
resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz"
182+
integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==
183+
184+
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14":
185+
version "1.4.15"
186+
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz"
187+
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
188+
189+
"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9":
190+
version "0.3.20"
191+
resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz"
192+
integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==
193+
dependencies:
194+
"@jridgewell/resolve-uri" "^3.1.0"
195+
"@jridgewell/sourcemap-codec" "^1.4.14"
196+
167197
"@types/history@*":
168198
version "4.7.9"
169199
resolved "https://registry.npmjs.org/@types/history/-/history-4.7.9.tgz"
@@ -256,7 +286,7 @@ camelize@^1.0.0:
256286
resolved "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz"
257287
integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=
258288

259-
chalk@^2.0.0:
289+
chalk@^2.4.2:
260290
version "2.4.2"
261291
resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz"
262292
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -275,7 +305,7 @@ color-convert@^1.9.0:
275305
276306
version "1.1.3"
277307
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
278-
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
308+
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
279309

280310
cross-fetch@^3.1.5:
281311
version "3.1.8"
@@ -318,7 +348,7 @@ esbuild@^0.12.17:
318348
escape-string-regexp@^1.0.5:
319349
version "1.0.5"
320350
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
321-
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
351+
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
322352

323353
globals@^11.1.0:
324354
version "11.12.0"
@@ -516,11 +546,6 @@ shallowequal@^1.1.0:
516546
resolved "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz"
517547
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==
518548

519-
source-map@^0.5.0:
520-
version "0.5.7"
521-
resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz"
522-
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
523-
524549
styled-components@^5.3.0, "styled-components@>= 2":
525550
version "5.3.3"
526551
resolved "https://registry.npmjs.org/styled-components/-/styled-components-5.3.3.tgz"

0 commit comments

Comments
 (0)