Get the user role on Login

This line isn’t correct.

context.email = user.email;

You need to add it to the context.accessToken (or the idToken respectively), which is via:

context.accessToken['https://any-namespace/email']  = ...
context.accessToken['https://any-namespace/connection']  = ...

and it needs to be namespaced.