From b1233aa856d9b7cd18179c96a0a4856d3ab3b319 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 1 Nov 2016 19:14:33 +0100 Subject: Server: add log messages if the server refuses to serve local clients tokens --- server/controllers/api/clients.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/controllers/api/clients.js b/server/controllers/api/clients.js index b01354195..7755f6c2b 100644 --- a/server/controllers/api/clients.js +++ b/server/controllers/api/clients.js @@ -4,6 +4,7 @@ const express = require('express') const mongoose = require('mongoose') const constants = require('../../initializers/constants') +const logger = require('../../helpers/logger') const Client = mongoose.model('OAuthClient') @@ -22,6 +23,7 @@ function getLocalClient (req, res, next) { // Don't make this check if this is a test instance if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) { + logger.info('Getting client tokens for host %s is forbidden (expected %s).', req.get('host'), headerHostShouldBe) return res.type('json').status(403).end() } -- cgit v1.2.3