Performing side effects on Acton doesn't work

I created a custom action

exports.onExecutePostLogin = async (event, api) => {
  api.accessToken.setCustomClaim('https://example.com/custom/claim', 'Custom bar value');
  api.user.setAppMetadata('myParam', 'bar');
  api.user.setUserMetadata('myParam', 'foo');
  api.idToken.setCustomClaim('https://example.com/custom/claim', 'Custom foo value');
};

which does some side effects on post login. I also added that into Login flow.

I can see the successful login and successful execution of the action in the log.

However, it doesn’t do anything to the token. I don’t see any additional fields.

Did I miss anything?

Please help. Thanks in advance

I used Single Page Application quick React example code to do the login and examined the token.