I encounter a ‘forbidden’ error when calling const programTotals = await accounts.getAccount(user.id);
. Where do I need to set the permissions to resolve this issue?
1 Like
With the single line of code that you’ve provided, we can’t help you much.
I’m guessing you’re using wix-loyalty.v2
Go through the documentation and you’ll find out that you need to elevate this function using wix-auth.
https://dev.wix.com/docs/velo/api-reference/wix-loyalty-v2/accounts/get-account
If you still get errors, use user._id
instead of user.id
. That’s the standard Wix syntax.
Might also want to consider using wix-members-frontend instead of the deprecated wix-users
1 Like