diff --git a/server/routes/auth.ts b/server/routes/auth.ts index 69d2fd52..7c92db62 100644 --- a/server/routes/auth.ts +++ b/server/routes/auth.ts @@ -196,10 +196,8 @@ authRoutes.post('/jellyfin', async (req, res, next) => { settings.jellyfin.hostname !== '' ) { return res.status(500).json({ error: 'Jellyfin login is disabled' }); - } else if (!body.username || !body.password) { - return res - .status(500) - .json({ error: 'You must provide an username and a password' }); + } else if (!body.username) { + return res.status(500).json({ error: 'You must provide an username' }); } else if (settings.jellyfin.hostname !== '' && body.hostname) { return res .status(500) @@ -332,7 +330,7 @@ authRoutes.post('/jellyfin', async (req, res, next) => { const passedExplicitPassword = body.password && body.password.length > 0; if (passedExplicitPassword) { - await user.setPassword(body.password); + await user.setPassword(body.password ?? ''); } await userRepository.save(user); } diff --git a/src/components/Login/JellyfinLogin.tsx b/src/components/Login/JellyfinLogin.tsx index c93c9268..a6cb0c0c 100644 --- a/src/components/Login/JellyfinLogin.tsx +++ b/src/components/Login/JellyfinLogin.tsx @@ -1,12 +1,11 @@ +import axios from 'axios'; +import { Field, Form, Formik } from 'formik'; import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import Button from '../Common/Button'; - -import { Field, Form, Formik } from 'formik'; -import * as Yup from 'yup'; -import axios from 'axios'; import { useToasts } from 'react-toast-notifications'; +import * as Yup from 'yup'; import useSettings from '../../hooks/useSettings'; +import Button from '../Common/Button'; const messages = defineMessages({ username: 'Username', @@ -63,9 +62,7 @@ const JellyfinLogin: React.FC = ({ username: Yup.string().required( intl.formatMessage(messages.validationusernamerequired) ), - password: Yup.string().required( - intl.formatMessage(messages.validationpasswordrequired) - ), + password: Yup.string(), }); return ( = ({ username: Yup.string().required( intl.formatMessage(messages.validationusernamerequired) ), - password: Yup.string().required( - intl.formatMessage(messages.validationpasswordrequired) - ), + password: Yup.string(), }); return (