diff --git a/package.json b/package.json index c74580e..0f37639 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sikka/hajar", - "version": "1.1.30", + "version": "1.1.31", "description": "Toolkit to create SaaS applications", "author": "Sikka Software (http://sikka.io)", "license": "MIT", diff --git a/src/core/authentication/index.js b/src/core/authentication/index.js index 9f43733..6cf3a0d 100644 --- a/src/core/authentication/index.js +++ b/src/core/authentication/index.js @@ -138,13 +138,11 @@ class HajarAuth { const newCustomer = await customer.save(); const token = this.jwt.sign({ userId: newUser._id }, this.secret); - const finalUser = { - ...newCustomer.toObject(), - ...newUser.toObject(), - }; + return { success: true, - user: finalUser, + user: { ...newUser.toObject() }, + customer: { ...newCustomer.toObject() }, token, }; } catch (error) {