feat(auth): send real information on login (#470)

* feat(auth): send real ip on login

* feat(auth): send application name on login
This commit is contained in:
THOMAS B
2024-05-24 18:05:05 +02:00
committed by GitHub
parent fed66f0702
commit d765055da8
2 changed files with 19 additions and 4 deletions

View File

@@ -104,9 +104,9 @@ class JellyfinAPI {
let authHeaderVal = '';
if (this.authToken) {
authHeaderVal = `MediaBrowser Client="Overseerr", Device="Axios", DeviceId="${deviceId}", Version="10.8.0", Token="${authToken}"`;
authHeaderVal = `MediaBrowser Client="Jellyseerr", Device="Jellyseerr", DeviceId="${deviceId}", Version="10.8.0", Token="${authToken}"`;
} else {
authHeaderVal = `MediaBrowser Client="Overseerr", Device="Axios", DeviceId="${deviceId}", Version="10.8.0"`;
authHeaderVal = `MediaBrowser Client="Jellyseerr", Device="Jellyseerr", DeviceId="${deviceId}", Version="10.8.0"`;
}
this.axios = axios.create({
@@ -121,14 +121,23 @@ class JellyfinAPI {
public async login(
Username?: string,
Password?: string
Password?: string,
ClientIP?: string
): Promise<JellyfinLoginResponse> {
try {
const headers = ClientIP
? {
'X-Forwarded-For': ClientIP,
}
: {};
const account = await this.axios.post<JellyfinLoginResponse>(
'/Users/AuthenticateByName',
{
Username: Username,
Pw: Password,
},
{
headers: headers,
}
);