Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Are you accessing it from the same domain? If yes, generate a nonce and send it along as a X-WP-Nonce header, if not use a JWT plugin (i.e. if you access from a different domain and don't have a cookie).
When I write plugins, I just add a nonce from PHP accessible via JS, and add it to headers (as most stuff would be React/plain JS inside WP-admin). This is what WP recommends too, if you're using it on the same domain.
Let me know, I can send over some code if you need.
Edit: for your custom endpoints, there's a permission callback that returns a boolean. You can do any check you need there (user logged in, user can edit posts ...).
wpApiSettings.nonce