Hi,
I created the next rule:
function addAttributes(user, context, callback) {
context.idToken['https://example.com/login_counts'] = context.stats.loginsCount || 0;
context.idToken.login_counts = context.stats.loginsCount || 0;
callback(null, user, context);
}
GET userinfo response BEFORE using the above rule was:
{
"sub": "auth|012345"
"nickname": "test" ,
"name": "test@example.com",
"picture": "..."
"updated_at": "2022-02-21T11:49:20.539Z",
"email": "test@example.com",
"email_verified": false
}
AFTER using the rule:
{
"sub": "auth|012345"
"nickname": "test" ,
"name": "test@example.com",
"picture": "..."
"updated_at": "2022-02-21T11:49:20.539Z",
"email": "test@example.com",
"email_verified": false,
"https://example.com/login_counts": 208
}
EXPECTED
{
...
"https://example.com/login_counts": 208
"login_counts": 208
}
Any ideas???
Thanks.