diff --git a/web/src/api/Config.ts b/web/src/api/Config.ts index eb2dbc3f0..530d0f5fd 100644 --- a/web/src/api/Config.ts +++ b/web/src/api/Config.ts @@ -7,7 +7,16 @@ export class LoggingMiddleware implements Middleware { post(context: ResponseContext): Promise { tenant().then(tenant => { - console.debug(`authentik/api[${tenant.matchedDomain}]: ${context.response.status} ${context.init.method} ${context.url}`); + let msg = `authentik/api[${tenant.matchedDomain}]: `; + msg += `${context.response.status} ${context.init.method} ${context.url}`; + if (context.response.status >= 400) { + context.response.text().then(t => { + msg += ` => ${t}`; + console.debug(msg); + }); + } else { + console.debug(msg); + } }); return Promise.resolve(context.response); }