Hello,
We would like to show some language to a user if they have just created their account and logged in for the first time. Is there a way for us to tell if a user is logging in for the first time during or after the auth callback?
Thanks,
Paul
Hello,
We would like to show some language to a user if they have just created their account and logged in for the first time. Is there a way for us to tell if a user is logging in for the first time during or after the auth callback?
Thanks,
Paul
Within Rules, you can check context.stats.loginsCount===1 and i.e. add a custom claim to your ID token to handle it accordingly on your client side.
For example:
function (user, context, callback) {
const namespace = 'https://myapp.example.com/';
context.idToken[namespace + 'is_new'] = (context.stats.loginsCount === 1);
callback(null, user, context);
}
Similar threads in this forum:
Fantastic, will give that a go. Many thanks!
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.