mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 04:08:45 -05:00
Merge pull request #115 from CyferShepard/JellyfinNoPasswordFix
feat:Remove Requirement for Jellyfin Passwords (#108 #31)
This commit is contained in:
@@ -196,10 +196,8 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
|
|||||||
settings.jellyfin.hostname !== ''
|
settings.jellyfin.hostname !== ''
|
||||||
) {
|
) {
|
||||||
return res.status(500).json({ error: 'Jellyfin login is disabled' });
|
return res.status(500).json({ error: 'Jellyfin login is disabled' });
|
||||||
} else if (!body.username || !body.password) {
|
} else if (!body.username) {
|
||||||
return res
|
return res.status(500).json({ error: 'You must provide an username' });
|
||||||
.status(500)
|
|
||||||
.json({ error: 'You must provide an username and a password' });
|
|
||||||
} else if (settings.jellyfin.hostname !== '' && body.hostname) {
|
} else if (settings.jellyfin.hostname !== '' && body.hostname) {
|
||||||
return res
|
return res
|
||||||
.status(500)
|
.status(500)
|
||||||
@@ -332,7 +330,7 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
|
|||||||
const passedExplicitPassword =
|
const passedExplicitPassword =
|
||||||
body.password && body.password.length > 0;
|
body.password && body.password.length > 0;
|
||||||
if (passedExplicitPassword) {
|
if (passedExplicitPassword) {
|
||||||
await user.setPassword(body.password);
|
await user.setPassword(body.password ?? '');
|
||||||
}
|
}
|
||||||
await userRepository.save(user);
|
await userRepository.save(user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
import { Field, Form, Formik } from 'formik';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { defineMessages, useIntl } from 'react-intl';
|
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 { useToasts } from 'react-toast-notifications';
|
||||||
|
import * as Yup from 'yup';
|
||||||
import useSettings from '../../hooks/useSettings';
|
import useSettings from '../../hooks/useSettings';
|
||||||
|
import Button from '../Common/Button';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
username: 'Username',
|
username: 'Username',
|
||||||
@@ -63,9 +62,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
|
|||||||
username: Yup.string().required(
|
username: Yup.string().required(
|
||||||
intl.formatMessage(messages.validationusernamerequired)
|
intl.formatMessage(messages.validationusernamerequired)
|
||||||
),
|
),
|
||||||
password: Yup.string().required(
|
password: Yup.string(),
|
||||||
intl.formatMessage(messages.validationpasswordrequired)
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
@@ -201,9 +198,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
|
|||||||
username: Yup.string().required(
|
username: Yup.string().required(
|
||||||
intl.formatMessage(messages.validationusernamerequired)
|
intl.formatMessage(messages.validationusernamerequired)
|
||||||
),
|
),
|
||||||
password: Yup.string().required(
|
password: Yup.string(),
|
||||||
intl.formatMessage(messages.validationpasswordrequired)
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user