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

Commit

Permalink
fix(api): Correct the error codes changed in 2781b3a
Browse files Browse the repository at this point in the history
I accidentally changed it for invalid secret before. Corrected the tests as well.
  • Loading branch information
rishibaldawa committed Jun 8, 2015
1 parent 780aaee commit d0dba7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/error.js
Expand Up @@ -90,7 +90,7 @@ AppError.unknownClient = function unknownClient(clientId) {

AppError.incorrectSecret = function incorrectSecret(clientId) {
return new AppError({
code: 401,
code: 400,
error: 'Bad Request',
errno: 102,
message: 'Incorrect secret'
Expand All @@ -112,7 +112,7 @@ AppError.incorrectRedirect = function incorrectRedirect(uri) {

AppError.invalidAssertion = function invalidAssertion() {
return new AppError({
code: 400,
code: 401,
error: 'Bad Request',
errno: 104,
message: 'Invalid assertion'
Expand Down
4 changes: 2 additions & 2 deletions test/api.js
Expand Up @@ -337,7 +337,7 @@ describe('/v1', function() {
url: '/authorization',
payload: authParams()
}).then(function(res) {
assert.equal(res.result.code, 400);
assert.equal(res.result.code, 401);
assert.equal(res.result.message, 'Invalid assertion');
}).done(done, done);
});
Expand Down Expand Up @@ -631,7 +631,7 @@ describe('/v1', function() {
code: unique.code().toString('hex')
}
}).then(function(res) {
assert.equal(res.statusCode, 401);
assert.equal(res.statusCode, 400);
assert.equal(res.result.message, 'Incorrect secret');
}).done(done, done);
});
Expand Down

0 comments on commit d0dba7c

Please sign in to comment.