Serving React App To Non-Logged In NS Users Also p...
# sdf
e
Serving React App To Non-Logged In NS Users Also posted in Reddit... I have a react app in NS that works great when logged in. It has been great for the client for the existing use case where users were logged in, by serving it out of the folder: https://xxxxxxx.app.netsuite.com/c.xxxxxxx/suitebundle999999/index.html This folder structure has been beneficial, because it acts like a webserver so we don't have to compile the react app into a single file. We are changing the use case slightly to allow non-logged in users to access it via a pin stored on the user record. It's not really about licensing, but about the fact that a user can't be logged into two interfaces at once. There are often times where a user is logged into the terminal through the native UI, but needs to perform a quick customer fulfillment through our app. I can't seem to get NetSuite to serve out the app when a user isn't logged in. Below is what I've tried: 1. Using this URL: https://xxxxxxx.app.netsuite.com/c.xxxxxxx/suitebundle999999/index.html. It isn't available when not logged in (makes sense from a security perspective.) 2. Compiling the app to a single html file react app and serving this file out via the external URL in the NS file cabinet. It works, but when I try to acccess the Suitelet as non-logged in user, it CORS error, because the URL for the external Suitelet to retrieve data is: https://xxxxxxxx.extforms.netsuite.com/app/site/hosting/scriptlet.nl Uggh! 3. Serving the single file React App out of a Suitelet, to alleviate the CORS error. Taking the file above and when a certain request is made to a suitelet with administrator privileges and publicly available, it serves the html/compiled react file. 4. Tried adding the file to the folder "Web Site Hosting Files : Live Hosting Files : site". When logged in and served from the URL: https://xxxxxx.app.netsuite.com/core/media/media.nl?id=1854459&c=xxxxxx&h=VpYnN--P3hNnFKDoIKmAewiehf42sdagKn_vNrRBDXpl_6&_xt=.html (modified for anonymity) It works, but run into CORS error when trying to get data. When served out from the URL that is shown on the same page (whether or not logged in)... It doesn't work. It just provides a blank page and it's like the React app isn't able to process due to corruption in the file... https://xxxxxx.secure.netsuite.com/c.xxxxxxxx/site/index.html The general preference: "SuiteBundle files always available" is checked, but I'm not sure this makes a difference. Does anyone else have any ideas? Or an idea of what might be interfering with the file loading when a user isn't logged in? It's almost like NS is interfering with delivering the file when the user isn't logged in.
n
Maybe better in #C29HQS63G. Good luck!