Fix jellyfin auth endpoint

This commit is contained in:
jeffvli 2023-05-09 05:06:32 -07:00
parent bb27758310
commit 9b5bce34a0
3 changed files with 7 additions and 3 deletions

View file

@ -22,7 +22,7 @@ export const contract = c.router({
authenticate: {
body: jfType._parameters.authenticate,
method: 'POST',
path: 'auth/login',
path: 'users/authenticatebyname',
responses: {
200: jfType._response.authenticate,
400: jfType._response.error,

View file

@ -44,6 +44,7 @@ import {
import { jfApiClient } from '/@/renderer/api/jellyfin/jellyfin-api';
import { jfNormalize } from './jellyfin-normalize';
import { jfType } from '/@/renderer/api/jellyfin/jellyfin-types';
import packageJson from '../../../../package.json';
const formatCommaDelimitedString = (value: string[]) => {
return value.join(',');
@ -60,9 +61,12 @@ const authenticate = async (
const res = await jfApiClient({ server: null, url: cleanServerUrl }).authenticate({
body: {
Password: body.password,
Pw: body.password,
Username: body.username,
},
headers: {
'X-Emby-Authorization': `MediaBrowser Client="Feishin", Device="PC", DeviceId="Feishin", Version="${packageJson.version}"`,
},
});
if (res.status !== 200) {

View file

@ -265,7 +265,7 @@ const user = z.object({
});
const authenticateParameters = z.object({
Password: z.string(),
Pw: z.string(),
Username: z.string(),
});