Replace DatabaseError with ClientsError where applicable

This commit is contained in:
Johannes Zellner
2016-06-13 14:43:56 +02:00
parent f284b4cd83
commit 4e9dc75a37
5 changed files with 13 additions and 13 deletions

View File

@@ -5,8 +5,8 @@ var appdb = require('../appdb'),
assert = require('assert'),
authcodedb = require('../authcodedb'),
clients = require('../clients'),
ClientsError = clients.ClientsError,
config = require('../config.js'),
constants = require('../constants.js'),
DatabaseError = require('../databaseerror'),
debug = require('debug')('box:routes/oauth2'),
eventlog = require('../eventlog.js'),
@@ -405,7 +405,7 @@ var authorization = [
debug('authorization: client %s with callback to %s.', clientId, redirectURI);
clients.get(clientId, function (error, client) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(null, false);
if (error && error.reason === ClientsError.NOT_FOUND) return callback(null, false);
if (error) return callback(error);
// ignore the origin passed into form the client, but use the one from the clientdb