Updated createOrUpdateUser function in auth.js to return the expanded object IDs from the new user document directly, ensuring accurate data representation upon user creation or update.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good

This commit is contained in:
Tom Butcher 2026-07-26 00:43:32 +01:00
parent 5e71afe246
commit 4db7ffff6a

View File

@ -295,7 +295,7 @@ const createOrUpdateUser = async (userInfo) => {
lastName,
});
await newUser.save();
return expandObjectIds(newUser);
return expandObjectIds(newUser._doc);
} catch (error) {
logger.error('Error creating/updating user:', error);
throw error;