I wrote a Pre User Registration hook to add the user locale/language to the user meta data in order to send out a localized mail with the verification code , but I could not retrieve a value from context.renderLanguage
nor from context.request.language
within this hook after triggering the API call /passwordless/start despite I also added an authParams parameter with ui_locales: de
inside - here is my hook code:
module.exports = function (user, context, cb) {
var response = {};
user.user_metadata = user.user_metadata || {};
user.user_metadata.emailVerificationSentDate = new Date().valueOf();
console.log(`Set emailVerificationSentDate to ${user.user_metadata.emailVerificationSentDate}`);
user.user_metadata.lang = context.renderLanguage || context.request.language || 'en';
console.log(`Set lang to ${user.user_metadata.lang}`);
response.user = user;
cb(null, response);
};
If I am using the normal Auth0 dialog for signup, a value for context.renderLanguage
is available. But how can I transfer the user locale using passwordless signup by directly calling the API (not using any Auth0 UI). In fact I do not really wanted to directly use the Auth0 API, but have tried to use GitHub - auth0/react-native-auth0: React Native toolkit for Auth0 API.