From d008afffe5e79183c1d5bbcdddc5e15b1dd6713a Mon Sep 17 00:00:00 2001 From: frankpagan Date: Wed, 8 May 2024 19:52:11 -0500 Subject: [PATCH] fix: roles handling --- src/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index 412bca4..c3e4cbf 100644 --- a/src/client.js +++ b/src/client.js @@ -43,6 +43,8 @@ const CoCreateUser = { // const socket = Crud.socket.getSockets() // if (!socket[0] || !socket[0].connected || window && !window.navigator.onLine) { + + // ToDo: remove roles handling from client and implement a serverside solution similar to lazyloader webooks processOperators let key = { status: 'await', method: 'object.create', @@ -51,7 +53,7 @@ const CoCreateUser = { _id: user.object[0]._id, type: "user", key: user.object[0]._id, - roles: user.object[0].roles, + roles: user.object[0].roles || [user.object[0]['roles[]']], email: user.object[0].email, password: user.object[0].password || btoa('0000'), array: user.array