fix(auth): resolve unused variable errors

This commit is contained in:
0xsysr3ll
2025-04-26 17:37:32 +02:00
parent 0aa3f293bc
commit eaa3691671

View File

@@ -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({