Not sure if this is a bug or I haven’t set something up properly. In this video you can see that when I login I’m returned the id of the user in console. Then, when I refresh the page identify is false.
Both the login server action and the server connect on page load reference the same server action/api so why does the identity not persist?
When you process the log in, a cookie is sent to the device and stored. This is used later to validate the login for future api requests. Each time you add a SC to a page (or a SC form) that uses a restrict step or the identity, you will need to tick credentials to allow this cookie to be sent with the request.
I have made a feature request that mobile projects have it ticked by default:
Yeah, CORS on mobile projects is a PITA, particularly when testing from the browser
Each time you restart the project a new port is used it looks like yours is currently http://localhost:54331
On your web project that you are using to serve your APIs you need to manually add CORS entries as an array - there’s no way currently to do this through the UI
open /app/config/config.json
then adjust it to show any hostnames that are required:
I have some for a main website, and app endpoints but the final one above is my localhost test - I do sometimes need to update the port and publish (usually when I restart Wappler)
Do you feel it’s worth the hassle working with localhost in the browser? I don’t ever add the web platform to my mobile projects, so wondering if you feel it speeds up dev or provides some other benefit?
I use it mainly for developing the general design where changes might be frequent and involve small adjustments. I find it quicker to save and reload in browser in these circumstances. Most of the time though I use Simulator as my main tool
That’s what I figured…but to play devils advocate for a minute, I find that forcing an emulator causes me to code more before testing. Instead up jumping back and forth, I code a bunch of things, then test.