Hi @mathiasconradt , here is my current code,
function (user, context, callback) {
if (context.authorization !== null && context.authorization.roles !== null) {
context.idToken['https://any-namespace/roles'] = context.authorization.roles;
context.accessToken['https://any-namespace/roles'] = context.authorization.roles;
}
if (context !== null) {
context.connection = context.connection;
}
if (user !== null) {
context.email = user.email;
}
console.log("Context " + JSON.stringify(context));
console.log("User " + JSON.stringify(user));
console.log("User email " + user.email);
return callback(null, user, context);
}
I also tried other options like passing the connection and email in the accessToken but it gives me an error