Skip to content

Commit

Permalink
chore : update register admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansourkira committed Feb 27, 2024
1 parent 7edb2bd commit 78e3cef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sikka/hajar",
"version": "1.1.49",
"version": "1.1.50",
"description": "Toolkit to create SaaS applications",
"author": "Sikka Software <[email protected]> (http://sikka.io)",
"license": "MIT",
Expand Down
8 changes: 3 additions & 5 deletions src/core/authentication/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ class HajarAuth {
const newAdmin = await admin.save();

const token = this.jwt.sign({ userId: newUser._id }, this.secret);
const finalUser = {
...newAdmin.toObject(),
...newUser.toObject(),
};

return {
success: true,
user: finalUser,
user: { ...newUser.toObject() },
admin: { ...newAdmin.toObject() },
token,
};
} catch (error) {
Expand Down

0 comments on commit 78e3cef

Please sign in to comment.