refactor(api): more logging for ip forwarding during auth

This commit is contained in:
fallenbagel
2024-06-12 17:06:11 +05:00
parent f735d86064
commit fdd4dcd847

View File

@@ -133,6 +133,11 @@ class JellyfinAPI extends ExternalAPI {
}
: {};
logger.debug(`Logging in to Jellyfin server: ${this.jellyfinHost}`, {
label: 'Jellyfin API',
ip: ClientIP,
});
const authResponse = await this.post<JellyfinLoginResponse>(
'/Users/AuthenticateByName',
{
@@ -143,9 +148,17 @@ class JellyfinAPI extends ExternalAPI {
headers: headers,
}
);
logger.debug(`Logged in to Jellyfin server: ${this.jellyfinHost}`, {
label: 'Jellyfin API',
response: authResponse,
});
return authResponse;
} catch (e) {
logger.debug(e, {
label: 'Jellyfin API',
});
const status = e.response?.status;
const networkErrorCodes = new Set([