Site icon Hip-Hop Website Design and Development

WordPress rest API does not auth on the same domain

I’m using WordPress version 5.8.2 rest API and using preact to create a form and embed it into the WordPress custom pages.

everything works fine when I develop local, and when I embed it into the custom page, the basic auth does not work and returns this error.

VM537:1 
        
       GET http://example.com/wp-json/gf/v2/entries/98 401 (Unauthorized)