Auth0 post registration action doesn't work

Hi Dan,
I uploaded the follwing:

var AWS = require("aws-sdk");
exports.onExecutePostLogin = async (event, api) => {
  try{
    console.log("adding the user to DynamoDB");
    api.user.setAppMetadata("addedToDynamoDB", "true");
  } catch (err) {
    console.log(err)
  }
};

Then from database connections clicked on Try Connection, used database login, filled in the login form, and had a confirmed login.
Check user record for app metadata: nothing, checked for logs, no trace action ever run.

steve