in src/Amazon.AspNetCore.Identity.Cognito/CognitoUserStore/CognitoUserStore.IUserRoleStore.cs [41:54]
public virtual async Task<TUser> FindByIdAsync(string userId, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
try
{
// The userId can be the userName, the email or the phone number depending on the User Pool login policy
var user = await _pool.FindByIdAsync(userId).ConfigureAwait(false);
return user as TUser;
}
catch (AmazonCognitoIdentityProviderException e)
{
throw new CognitoServiceException("Failed to find the Cognito User by Id", e);
}
}