Look up a user, and return an object implementing the
If a number is passed to this function, look up the user with that user ID.
An exception will be thrown if the user does not exist.
If a string is passed to this function, look up a user with that email address.
null will be returned if no user has that email address.
Look up the user with the
ref property set to this
null will be returned if no such user exists.
If more than one user has this
ref, your code should not rely on which one is returned.
Array of zero or more
SecurityPrincipal objects which have the specified email address and are currently active.
In general, you should use
O.user(emailAddress), which will return the oldest active
SecurityPrincipal object with that email address. However, if you’re writing a custom authentication system, you may need to create multiple users with the same email address and this function will be useful to find them all.