Get user information
Last updated
Last updated
This page instructs you how to get information about the user that is currently logged in.
The user must be logged into your application via Passport
The getUserInfo
function on the Passport instance returns a promise that resolves with the following information about the currently logged-in user:
The email address of the logged-in user. This property will be undefined if the email
scope has not been requested.
sub
The subject (unique identifier) of the logged-in user.
nickname
This value will always be undefined
for the time being.
Note that the getUserInfo
function may throw the following error:
NOT_LOGGED_IN_ERROR
No user is logged in at the time of the function call.
Verify that a user has logged in before attempting to call getUserInfo
1 Apple Social Login Email Masking Restrictions: Partners implementing the Apple Social Login within Passport should note a potential restriction regarding the user's email address. If a user chooses to mask their email address, the email address return will appear as xyz@privaterelay.appleid.com
. A masked email prevents partners from directly emailing users. Partners must consider this limitation while interacting with users who have enabled email masking through Apple Social Login. For any further inquiries or assistance, please get in touch with our dedicated support team.