I am working on a lightning component which would allow the admin to select what type of community: Authenticated or Public. After selecting the community type, I need to show the relevant communities in the view.
I checked the Network object to see if there's field which I could use to decide a particular community is public or not but I don't find any such field to do so.
Is there's a way to get all the public and authenticated communities in Apex?