Compare commits

...
8 Commits
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -12,6 +12,8 @@
// req.locals.jwtToken property.
const getTokenFromHeaders = (req, res, next) => {
try {
console.log('req.headers: ', req.headers)
// Only executes if the authorization header exists.
if (req.headers.authorization) {
// Retrieve the auth string from the header object.
@@ -21,7 +23,7 @@ const getTokenFromHeaders = (req, res, next) => {
if (authStr.split(' ')[0] === 'Token') {
const token = authStr.split(' ')[1]
// console.log(`JWT found: ${token}`)
console.log(`JWT found: ${token}`)
// Create the req.locals property if it does not yet exist.
if (!req.locals) {
+3 -1
View File
@@ -221,7 +221,9 @@ class RateLimits {
// should be returned by the middleware.
async trackRateLimits (req, res, jwtToken) {
const debugInfo = {
jwtToken
jwtToken,
userObj: req.body.usrObj,
locals: req.locals
}
// Anonymous rate limits are used by default.