Hi,
I am trying to add ‘user_metadata’ for each user on registration.
I am currently allowing users to only register via Spotify. It is all working fine for me, except that i can’t create a default value in my ‘user_metadata’.
I have followed the example for it, but cannot get it to work.
Do i need to pass values into it?
exports.onExecutePreUserRegistration = async (event, api) => { /**
- Handler that will be called during the execution of a PreUserRegistration flow.
- @param {Event} event - Details about the context and user that is attempting to register.
-
@param {PreUserRegistrationAPI} api - Interface whose methods can be used to change the behavior of the signup.
*/
module.exports = function (user, context, cb) {
var response = {};
// Add user or app metadata to the newly-created user
response.user = {
user_metadata: { foo: ‘bar’ },
app_metadata: { vip: true, score: 7 }
};
response.user = user;
cb(null, response);
};
};