Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit f6d603c

Browse files
vbudhramvladikoff
authored andcommitted
feat(totp): vlad updates for totp (#313) r=@vladikoff
1 parent ee19e1b commit f6d603c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

db-server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function createServer(db) {
126126

127127
api.get('/keyFetchToken/:id/verified', withIdAndBody(db.keyFetchTokenWithVerificationStatus))
128128
api.post('/tokens/:id/verify', withIdAndBody(db.verifyTokens))
129-
api.post('/tokens/:id/verifyWith', withIdAndBody(db.verifyTokensWithMethod))
129+
api.post('/tokens/:id/verifyWithMethod', withIdAndBody(db.verifyTokensWithMethod))
130130
api.post('/tokens/:code/verifyCode', withParamsAndBody(db.verifyTokenCode))
131131

132132
api.get('/accountResetToken/:id', withIdAndBody(db.accountResetToken))

db-server/test/backend/remote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ module.exports = function(cfg, makeServer) {
16051605
const verifyOptions = {
16061606
verificationMethod: 'totp-2fa',
16071607
}
1608-
return client.postThen('/tokens/' + user.sessionTokenId + '/verifyWith', verifyOptions)
1608+
return client.postThen('/tokens/' + user.sessionTokenId + '/verifyWithMethod', verifyOptions)
16091609
.then((res) => {
16101610
respOkEmpty(res)
16111611
return client.getThen('/sessionToken/' + user.sessionTokenId + '/device')

docs/API.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The following datatypes are used throughout this document:
9191
* forgotPasswordVerified : `POST /passwordForgotToken/:id/verified`
9292
* Unverified tokens:
9393
* verifyTokens : `POST /tokens/:tokenVerificationId/verify`
94-
* verifyTokensWithMethod : `POST /tokens/:tokenId/verifyWith`
94+
* verifyTokensWithMethod : `POST /tokens/:tokenId/verifyWithMethod`
9595
* Sign-in codes
9696
* createSigninCode : `PUT /signinCodes/:code`
9797
* consumeSigninCode : `POST /signinCodes/:code/consume`
@@ -1745,7 +1745,7 @@ Content-Length: 2
17451745
* Body : {"code":"InternalError","message":"...<message related to the error>..."}
17461746
```
17471747

1748-
## verifyTokens : `POST /tokens/<tokenId>/verifyWith`
1748+
## verifyTokens : `POST /tokens/<tokenId>/verifyWithMethod`
17491749

17501750
This method verifies sessionTokens, keyFetchTokens and sets
17511751
the the verification method used on the sessions table.
@@ -1758,13 +1758,13 @@ curl \
17581758
-X POST \
17591759
-H "Content-Type: application/json" \
17601760
-d '{"verificatioMethod":"totp-2fa"}' \
1761-
http://localhost:8000/tokens/8e8c27b704dbf6a5dc556453c92e7506/verifyWith
1761+
http://localhost:8000/tokens/8e8c27b704dbf6a5dc556453c92e7506/verifyWithMethod
17621762
```
17631763

17641764
### Request
17651765

17661766
* Method : POST
1767-
* Path : `/tokens/<tokenId>/verifyWith`
1767+
* Path : `/tokens/<tokenId>/verifyWithMethod`
17681768
* tokenVerificationId : hex128
17691769
* Params:
17701770
* uid : hex128

0 commit comments

Comments
 (0)