[SOLVED] Can't save user data using cloud functions

Hello!

I’m currently testing some commands and features to use in a game and my goal was to make all the game logic work inside cloud functions. The problem is: I can’t make the set() function to work to add/edit data from the User.

When I add or edit from a custom object it apparently works fine. What could I be doing wrong? If edit user data like this it’s something that is not possible, how could I create an object automatically when the user logs in to store their data?

Sincerely,

Use master key to edit users

I was already using it. I think the problem was in the promise handling… At least it’s working fine now. Thank you!

How to edit moralis cloud function in new version?
Legacy is not working for now?
There is no edit button for cloud function.

you can use the CLI (moralis-admin-cli) to upload new cloud code, there isn’t an edit option in the new interface

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: Request failed with status code 403

I am gettting this error.

you could get that error when wrong credentials are used. you should be able to find directly in admin interface a command line that you can run that also contains the credentials, in the same page where you see the cloud code

Thanks, its working fine

1 Like

I got directly in admin interface a command line [moralis-admin-cli watch-…] but I am getting error that [Error: Request failed with status code 403].

You need to use the api secrets from you account info in that command, it doesn’t work now only to copy paste that command, you have to edit it with your api secrets

Thanks!! :grinning:

Used command is “moralis-admin-cli watch-cloud-folder --moralisApiKey [Your cli api key] --moralisApiSecret [Your cli api secret] --moralisSubdomain [subdomain your DappURL] --autoSave 1 --moralisCloudfolder /path/to/cloud/folder”

its working fine.

1 Like