Hi, colleagues
During the last days I found that getRoles() is getting not working from the backend. It is worked ok on my site during the last 1.5 years but in these coronadays I observed that something happened and it is getting generate exception. It seems Wix people hiddenly changed a bit an APIs and this functionality is getting not available anymore.
Do anybody knows what would happened and how to fix this?
very small snippet from the backend:
import wixUsers from 'wix-users-backend' export function getUserCaps111() { let user = wixUsers.currentUser; return user.getRoles().then((result)=> { return (result); }); }
btw, getRoles() still works from the client side, but this is not what I need because I've got a lot of existing code around backend autorization.
Tnx. Alexey
Hey @granesp I'm not aware of what was a year ago but wix-users-backend do support getRoles() see the example here:
https://www.wix.com/velo/reference/wix-users-backend/currentuser
Regarding your code:
'import wixUsers from 'wix-users-backend' isn't the right syntax, try using:
import wixUsersBackend from 'wix-users-backend';
ON YEAR LATER.... AND THER?S NO ANSWER !!!!!!!!!!!!!!!! WOW
Thanks, Alexey. I've sent this to QA to investigate since it's been reported here a few times.