loopback/server/middleware
Aaron Buchanan 50e0e4808a
Fix user-literal rewrite for anonymous requests
Currently any `currentUserLiteral` routes when accessed with a bad
token throw a 500 due to a SQL error that is raised because
`Model.findById` is invoked with `id={currentUserLiteral}`
(`id=me` in our case) when the url rewrite fails.

This commit changes the token middleware to return 401 Not Authorized
when the client is requesting a currentUserLiteral route without
a valid access token.
2017-04-04 18:55:34 +02:00
..
context.js Globalize current-context deprecation messages 2016-08-10 12:40:38 +02:00
error-handler.js update/insert copyright notices 2016-05-03 17:10:46 -07:00
favicon.js Deprecate getters for express 3.x middleware 2016-05-31 18:58:10 +02:00
rest.js update/insert copyright notices 2016-05-03 17:10:46 -07:00
static.js update/insert copyright notices 2016-05-03 17:10:46 -07:00
status.js update/insert copyright notices 2016-05-03 17:10:46 -07:00
token.js Fix user-literal rewrite for anonymous requests 2017-04-04 18:55:34 +02:00
url-not-found.js update/insert copyright notices 2016-05-03 17:10:46 -07:00