function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nagaraja SV 12Nagaraja SV 12 

Server responded with a status of 401 in lightening out

I have added lightening App  to visualforce page it working well But

the issue here is Added that visualforcepage to sites 

I am geeting below  

http://suragani-developer-edition.ap2.force.com/Customers/c/ContactsAPP.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT Failed to load resource: the server responded with a status of 401 (Unauthorized)

Any suggestions 


VF page code

<apex:page standardController="contact" sidebar="false" showHeader="false" cache="false">
 

<apex:composition template="{!$Site.Template}"> 
    <apex:define name="body">

               
    <apex:includeLightning />

    <div id="lightning" />

    <script>
        $Lightning.use("c:ContactsAPP", function() {
          $Lightning.createComponent("c:contacts",
          {},
          "lightning",
          function(cmp) {
            console.log("Component created!");
                    console.log(cmp);
          });
        });
    </script>

        
   
    </apex:define>
</apex:composition>

</apex:page>

Lightening APP
<aura:application access="GLOBAL" extends="ltng:outApp">
   <aura:dependency resource="c:contacts"/>
</aura:application>