How to get email of Derby-Login user

55 Views Asked by At

I can easily get the user id from model.get("session.userId"); I am having trouble finding out how to use this to get the user's email.

1

There are 1 best solutions below

0
On BEST ANSWER

If you have a Users collection, you can use the userId to get the user object which would have the user's email.

// in the controller
var userId = model.get('session.userId');
userEmail = model.get('users.' + userId + '.email');

// in the view
<div>#root.users[userId].email</div>

Hope that is helpful :)