Proxy

Salesforce won’t let you lauch request from the same app browser.

To be able to lauch request without cors errors add this in nuxtconfig.js

http: {
      proxies: {
        '/proxy-path': {
          target: 'target-url',
          changeOrigin: true,
          secure: false,
          pathRewrite: { '^/proxy-path': '' },
        },
      },

Localhost

Salesforce don’t allow request from localhost.

Now you’ll need to use a reverse proxy

  1. Install ngrok follow the setup
  2. Run your project on localhost
  3. In shell type ngrok http ‘your_localhost_port’. Note the Forwarding url (https://H-A-S-H.eu.ngrok.io)
  4. In salesforce : Setup → Security → Remote Site Settings. Add an new remote site

Untitled

  1. You can now use your app on the forwarding url (https://H-A-S-H.eu.ngrok.io), send request, and see your changes without having to deploy on an other instance.

Security/cors

Allowed Origins List

add the domain, for example https://sandbox.iomedia.ch.

Cross-Origin Resource Sharing (CORS) Policy Settings

Manage Connected Apps

API (Enable OAuth Settings)