[SOLVED] getNativeBalance return 403 error on self-server

:1337/server/functions/getNativeBalance
403 error
error “unauthorized”

How are you calling getNativeBalance in your code? May be related to this.

As a workaround for now, in your server’s src/index.ts, you can add this:

...

app.use('/server/functions/:functionName', (req, res, next) => {
  req.headers['x-parse-application-id'] = 'appidhere';
  next();
});

app.use(`/server`, parseServer);

Then run npm run build and then npm run start.

1 Like

const { getBalances, data: balance, nativeToken, error, isLoading } = useNativeBalance();

after i add this, npm run start - with error

worked after add only this part:

app.use('/server/functions/:functionName', (req, res, next) => {
  req.headers['x-parse-application-id'] = 'appidhere';
  next();
});

What is the error? Don’t copy over app.use('/server', parseServer); if yours looks different, that was just an example of where to put the code.

yes it’s worked. thx.

Update will be posted here when there is an official fix.

An update to moralis-v1 SDK for this issue has been released.