From eaa3691671e0de3cc9d77f9a7a705b2114c55026 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <0xsysr3ll@pm.me> Date: Sat, 26 Apr 2025 17:37:32 +0200 Subject: [PATCH] fix(auth): resolve unused variable errors --- server/routes/auth.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/routes/auth.ts b/server/routes/auth.ts index 76a519fe..97c0c55e 100644 --- a/server/routes/auth.ts +++ b/server/routes/auth.ts @@ -549,6 +549,11 @@ authRoutes.post('/plex/profile/select', async (req, res, next) => { // Use the existing user profileUser = existingEmailUser; + + if (req.session) { + req.session.userId = profileUser.id; + } + return res.status(200).json(profileUser.filter() ?? {}); } else { // Then check for any other potential matches const allUsers = await userRepository.find(); @@ -566,6 +571,11 @@ authRoutes.post('/plex/profile/select', async (req, res, next) => { }); profileUser = matchingUser; + + if (req.session) { + req.session.userId = matchingUser.id; + } + return res.status(200).json(matchingUser.filter() ?? {}); } else { // Create a new profile user profileUser = new User({