diff --git a/backend/src/bundles/auth/auth.service.ts b/backend/src/bundles/auth/auth.service.ts index 8146599a8..a3e9f9b2f 100644 --- a/backend/src/bundles/auth/auth.service.ts +++ b/backend/src/bundles/auth/auth.service.ts @@ -46,9 +46,10 @@ class AuthService { }); } - const id = user.toObject().id; + const userObject = user.toObject(); + const id = { userObject }; const token = await tokenService.createToken(id); - return { ...user.toObject(), token }; + return { ...userObject, token }; } public async signUp(