Hey, I have read the documentation but I don’t understand the purpose in the namespace within the rules. So this is my rule:
function addAttributes(user, context, callback) {
const namespace = 'http://www.test.co.uk/';
context.idToken[namespace + 'user_metadata'] = user.user_metadata;
callback(null, user, context);
}
Which of course displays this when I login:
[
"http://www.test.co.uk/user_metadata" => [...],
"nickname" => "mlb",
"name" => "Martyn Lee Ball",
"picture" => "...",
"updated_at" => "2021-01-25T17:13:50.873Z"
]
As you can see http://www.test.co.uk/user_metadata
has been added and it contains the data, however all I want is user_metadata
, not any crap at the start, so it would be:
[
"user_metadata" => [...],
"nickname" => "mlb",
"name" => "Martyn Lee Ball",
"picture" => "...",
"updated_at" => "2021-01-25T17:13:50.873Z"
]