Skip to content

Commit

Permalink
Revert "Allow integers in approval_request data"
Browse files Browse the repository at this point in the history
This reverts commit e7c3cc2.
  • Loading branch information
holm authored and ruimarinho committed Jan 28, 2017
1 parent f465034 commit 355b6e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ export default class Client {
validate(request, {
body: {
approval_request: [is.required(), is.callback(value => {
return is.integer().check(value) === true || is.string().check(value) === true || is.plainObject().check(value) === true;
return is.string().check(value) === true || is.plainObject().check(value) === true;
})],
authy_id: [is.required(), is.authyId()],
callback_action: [is.required(), is.choice(['approval_request_status'])],
Expand Down
9 changes: 3 additions & 6 deletions test/client_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe('Client', () => {

it('should throw an error if `body.approval_request` is invalid', async () => {
try {
await client.verifyCallback({ body: { approval_request: true }, method: 'POST', protocol: 'http', url: '/' });
await client.verifyCallback({ body: { approval_request: 123 }, method: 'POST', protocol: 'http', url: '/' });

should.fail();
} catch (e) {
Expand Down Expand Up @@ -528,10 +528,7 @@ describe('Client', () => {
device_signing_time: 0,
encrypted: false,
flagged: false,
hidden_details: {
integer: 12,
string: 'foo'
},
hidden_details: {},
message: '.',
reason: null,
requester_details: null,
Expand All @@ -548,7 +545,7 @@ describe('Client', () => {
},
headers: {
host: 'foo.bar',
'x-authy-signature': '1oyl899IjkMH2Y1ldpdbhRSwVwlEHb7yzlITSeqLNsQ=',
'x-authy-signature': 'hqB6las54sMBA83GKs0U1QQi9ocJ2tH20SXHZNzfqqQ=',
'x-authy-signature-nonce': '1455825429'
},
method: 'POST',
Expand Down

0 comments on commit 355b6e7

Please sign in to comment.