Guest User

Untitled

a guest
Jun 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.38 KB | None | 0 0
  1. // Correct
  2.  
  3. Query {
  4. _mongooseOptions: {},
  5. mongooseCollection:
  6. NativeCollection {
  7. collection: Collection { s: [Object] },
  8. opts:
  9. { bufferCommands: true,
  10. capped: false,
  11. '$wasForceClosed': undefined },
  12. name: 'access_tokens',
  13. collectionName: 'access_tokens',
  14. conn:
  15. NativeConnection {
  16. base: [Object],
  17. collections: [Object],
  18. models: [Object],
  19. config: [Object],
  20. replica: false,
  21. options: null,
  22. otherDbs: [],
  23. relatedDbs: {},
  24. states: [Object],
  25. _readyState: 1,
  26. _closeCalled: false,
  27. _hasOpened: true,
  28. _listening: false,
  29. _connectionOptions: [Object],
  30. client: [Object],
  31. name: 'api',
  32. '$initialConnection': [Object],
  33. _events: [Object],
  34. _eventsCount: 1,
  35. db: [Object] },
  36. queue: [],
  37. buffer: false,
  38. emitter:
  39. EventEmitter {
  40. domain: null,
  41. _events: {},
  42. _eventsCount: 0,
  43. _maxListeners: undefined } },
  44. model:
  45. { [Function: model]
  46. hooks: Kareem { _pres: [Object], _posts: [Object] },
  47. base:
  48. Mongoose {
  49. connections: [Array],
  50. models: [Object],
  51. modelSchemas: [Object],
  52. options: [Object],
  53. _pluralize: [Function: pluralize],
  54. plugins: [Array] },
  55. modelName: 'access_token',
  56. model: [Function: model],
  57. db:
  58. NativeConnection {
  59. base: [Object],
  60. collections: [Object],
  61. models: [Object],
  62. config: [Object],
  63. replica: false,
  64. options: null,
  65. otherDbs: [],
  66. relatedDbs: {},
  67. states: [Object],
  68. _readyState: 1,
  69. _closeCalled: false,
  70. _hasOpened: true,
  71. _listening: false,
  72. _connectionOptions: [Object],
  73. client: [Object],
  74. name: 'api',
  75. '$initialConnection': [Object],
  76. _events: [Object],
  77. _eventsCount: 1,
  78. db: [Object] },
  79. discriminators: undefined,
  80. '$appliedMethods': true,
  81. '$appliedHooks': true,
  82. schema:
  83. Schema {
  84. obj: [Object],
  85. paths: [Object],
  86. aliases: {},
  87. subpaths: {},
  88. virtuals: [Object],
  89. singleNestedPaths: {},
  90. nested: {},
  91. inherits: {},
  92. callQueue: [],
  93. _indexes: [],
  94. methods: {},
  95. methodOptions: {},
  96. statics: {},
  97. tree: [Object],
  98. query: {},
  99. childSchemas: [],
  100. plugins: [Array],
  101. s: [Object],
  102. _userProvidedOptions: {},
  103. options: [Object],
  104. '$globalPluginsApplied': true,
  105. _requiredpaths: [] },
  106. collection:
  107. NativeCollection {
  108. collection: [Object],
  109. opts: [Object],
  110. name: 'access_tokens',
  111. collectionName: 'access_tokens',
  112. conn: [Object],
  113. queue: [],
  114. buffer: false,
  115. emitter: [Object] },
  116. Query: { [Function] base: [Object] },
  117. '$__insertMany': [Function],
  118. '$init': Promise { [Object], catch: [Function] } },
  119. schema:
  120. Schema {
  121. obj: { accessToken: [Object], expires: [Object], clientId: [Object] },
  122. paths:
  123. { accessToken: [Object],
  124. expires: [Object],
  125. clientId: [Object],
  126. _id: [Object],
  127. __v: [Object] },
  128. aliases: {},
  129. subpaths: {},
  130. virtuals: { id: [Object] },
  131. singleNestedPaths: {},
  132. nested: {},
  133. inherits: {},
  134. callQueue: [],
  135. _indexes: [],
  136. methods: {},
  137. methodOptions: {},
  138. statics: {},
  139. tree:
  140. { accessToken: [Object],
  141. expires: [Object],
  142. clientId: [Object],
  143. _id: [Object],
  144. __v: [Function: Number],
  145. id: [Object] },
  146. query: {},
  147. childSchemas: [],
  148. plugins: [ [Object], [Object], [Object], [Object], [Object] ],
  149. s: { hooks: [Object] },
  150. _userProvidedOptions: {},
  151. options:
  152. { typeKey: 'type',
  153. id: true,
  154. noVirtualId: false,
  155. _id: true,
  156. noId: false,
  157. validateBeforeSave: true,
  158. read: null,
  159. shardKey: null,
  160. autoIndex: null,
  161. minimize: true,
  162. discriminatorKey: '__t',
  163. versionKey: '__v',
  164. capped: false,
  165. bufferCommands: true,
  166. strict: true,
  167. pluralization: true },
  168. '$globalPluginsApplied': true,
  169. _requiredpaths: [] },
  170. op: 'findOne',
  171. options: {},
  172. _conditions: { accessToken: '7aaffa1ee270cfca8611a5235ccac6ff241e8175' },
  173. _fields: undefined,
  174. _update: undefined,
  175. _path: undefined,
  176. _distinct: undefined,
  177. _collection:
  178. NodeCollection {
  179. collection:
  180. NativeCollection {
  181. collection: [Object],
  182. opts: [Object],
  183. name: 'access_tokens',
  184. collectionName: 'access_tokens',
  185. conn: [Object],
  186. queue: [],
  187. buffer: false,
  188. emitter: [Object] },
  189. collectionName: 'access_tokens' },
  190. _traceFunction: undefined }
  191.  
  192.  
  193. //Incorrect
  194.  
  195. 1 7aaffa1ee270cfca8611a5235ccac6ff241e817
  196. Query {
  197. _mongooseOptions: {},
  198. mongooseCollection:
  199. NativeCollection {
  200. collection: Collection { s: [Object] },
  201. opts:
  202. { bufferCommands: true,
  203. capped: false,
  204. '$wasForceClosed': undefined },
  205. name: 'access_tokens',
  206. collectionName: 'access_tokens',
  207. conn:
  208. NativeConnection {
  209. base: [Object],
  210. collections: [Object],
  211. models: [Object],
  212. config: [Object],
  213. replica: false,
  214. options: null,
  215. otherDbs: [],
  216. relatedDbs: {},
  217. states: [Object],
  218. _readyState: 1,
  219. _closeCalled: false,
  220. _hasOpened: true,
  221. _listening: false,
  222. _connectionOptions: [Object],
  223. client: [Object],
  224. name: 'api',
  225. '$initialConnection': [Object],
  226. _events: [Object],
  227. _eventsCount: 1,
  228. db: [Object] },
  229. queue: [],
  230. buffer: false,
  231. emitter:
  232. EventEmitter {
  233. domain: null,
  234. _events: {},
  235. _eventsCount: 0,
  236. _maxListeners: undefined } },
  237. model:
  238. { [Function: model]
  239. hooks: Kareem { _pres: [Object], _posts: [Object] },
  240. base:
  241. Mongoose {
  242. connections: [Array],
  243. models: [Object],
  244. modelSchemas: [Object],
  245. options: [Object],
  246. _pluralize: [Function: pluralize],
  247. plugins: [Array] },
  248. modelName: 'access_token',
  249. model: [Function: model],
  250. db:
  251. NativeConnection {
  252. base: [Object],
  253. collections: [Object],
  254. models: [Object],
  255. config: [Object],
  256. replica: false,
  257. options: null,
  258. otherDbs: [],
  259. relatedDbs: {},
  260. states: [Object],
  261. _readyState: 1,
  262. _closeCalled: false,
  263. _hasOpened: true,
  264. _listening: false,
  265. _connectionOptions: [Object],
  266. client: [Object],
  267. name: 'api',
  268. '$initialConnection': [Object],
  269. _events: [Object],
  270. _eventsCount: 1,
  271. db: [Object] },
  272. discriminators: undefined,
  273. '$appliedMethods': true,
  274. '$appliedHooks': true,
  275. schema:
  276. Schema {
  277. obj: [Object],
  278. paths: [Object],
  279. aliases: {},
  280. subpaths: {},
  281. virtuals: [Object],
  282. singleNestedPaths: {},
  283. nested: {},
  284. inherits: {},
  285. callQueue: [],
  286. _indexes: [],
  287. methods: {},
  288. methodOptions: {},
  289. statics: {},
  290. tree: [Object],
  291. query: {},
  292. childSchemas: [],
  293. plugins: [Array],
  294. s: [Object],
  295. _userProvidedOptions: {},
  296. options: [Object],
  297. '$globalPluginsApplied': true,
  298. _requiredpaths: [] },
  299. collection:
  300. NativeCollection {
  301. collection: [Object],
  302. opts: [Object],
  303. name: 'access_tokens',
  304. collectionName: 'access_tokens',
  305. conn: [Object],
  306. queue: [],
  307. buffer: false,
  308. emitter: [Object] },
  309. Query: { [Function] base: [Object] },
  310. '$__insertMany': [Function],
  311. '$init': Promise { [Object], catch: [Function] } },
  312. schema:
  313. Schema {
  314. obj: { accessToken: [Object], expires: [Object], clientId: [Object] },
  315. paths:
  316. { accessToken: [Object],
  317. expires: [Object],
  318. clientId: [Object],
  319. _id: [Object],
  320. __v: [Object] },
  321. aliases: {},
  322. subpaths: {},
  323. virtuals: { id: [Object] },
  324. singleNestedPaths: {},
  325. nested: {},
  326. inherits: {},
  327. callQueue: [],
  328. _indexes: [],
  329. methods: {},
  330. methodOptions: {},
  331. statics: {},
  332. tree:
  333. { accessToken: [Object],
  334. expires: [Object],
  335. clientId: [Object],
  336. _id: [Object],
  337. __v: [Function: Number],
  338. id: [Object] },
  339. query: {},
  340. childSchemas: [],
  341. plugins: [ [Object], [Object], [Object], [Object], [Object] ],
  342. s: { hooks: [Object] },
  343. _userProvidedOptions: {},
  344. options:
  345. { typeKey: 'type',
  346. id: true,
  347. noVirtualId: false,
  348. _id: true,
  349. noId: false,
  350. validateBeforeSave: true,
  351. read: null,
  352. shardKey: null,
  353. autoIndex: null,
  354. minimize: true,
  355. discriminatorKey: '__t',
  356. versionKey: '__v',
  357. capped: false,
  358. bufferCommands: true,
  359. strict: true,
  360. pluralization: true },
  361. '$globalPluginsApplied': true,
  362. _requiredpaths: [] },
  363. op: 'findOne',
  364. options: {},
  365. _conditions: { accessToken: '7aaffa1ee270cfca8611a5235ccac6ff241e817' },
  366. _fields: undefined,
  367. _update: undefined,
  368. _path: undefined,
  369. _distinct: undefined,
  370. _collection:
  371. NodeCollection {
  372. collection:
  373. NativeCollection {
  374. collection: [Object],
  375. opts: [Object],
  376. name: 'access_tokens',
  377. collectionName: 'access_tokens',
  378. conn: [Object],
  379. queue: [],
  380. buffer: false,
  381. emitter: [Object] },
  382. collectionName: 'access_tokens' },
  383. _traceFunction: undefined }
  384. OAuth2Error: The access token provided is invalid.
  385. at OAuth2Error (/home/vagrant/api/node_modules/node-oauth2-server/lib/error.js:30:12)
  386. at /home/vagrant/api/node_modules/node-oauth2-server/lib/authorise.js:114:19
  387. at /home/vagrant/api/node_modules/mongoose/lib/model.js:4233:16
  388. at model.Query.Query._completeOne (/home/vagrant/api/node_modules/mongoose/lib/query.js:1513:12)
  389. at Immediate.Query.base.findOne.call (/home/vagrant/api/node_modules/mongoose/lib/query.js:1569:10)
  390. at Immediate.<anonymous> (/home/vagrant/api/node_modules/mquery/lib/utils.js:119:16)
  391. at runCallback (timers.js:800:20)
  392. at tryOnImmediate (timers.js:762:5)
  393. at processImmediate [as _immediateCallback] (timers.js:733:5)
Add Comment
Please, Sign In to add comment