From 103350fe146fbf212b12a3348bcfb40399e1a0fc Mon Sep 17 00:00:00 2001 From: notfakie <103784113+notfakie@users.noreply.github.com> Date: Sun, 24 Apr 2022 14:58:30 +1200 Subject: [PATCH] feat: initialize Jellyfin/Emby users with local login --- server/routes/auth.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/routes/auth.ts b/server/routes/auth.ts index 292ffb0e8..c1473c911 100644 --- a/server/routes/auth.ts +++ b/server/routes/auth.ts @@ -301,6 +301,12 @@ authRoutes.post('/jellyfin', async (req, res, next) => { : '/os_logo_square.png', userType: UserType.JELLYFIN, }); + //initialize Jellyfin/Emby users with local login + const passedExplicitPassword = + body.password && body.password.length > 0; + if (passedExplicitPassword) { + await user.setPassword(body.password); + } await userRepository.save(user); } } @@ -562,8 +568,6 @@ authRoutes.post('/reset-password/:guid', async (req, res, next) => { message: 'Invalid password reset link.', }); } - - await user.setPassword(req.body.password); user.recoveryLinkExpirationDate = null; userRepository.save(user); logger.info('Successfully reset password', {