Mobile App: Login successful but not retrieving identity

So how have you done this Brad?
How is this recordset loaded? When? How is the data added on the page?
Also - what is shown in the dev tools > network > xhr after the log in? Do you see the identify step returning there?

<p>Logged in as: {{userDetails.data.query1.client_first}} <br>Identity:&nbsp; {{userDetails.data.identity}} <br> Form Status: {{formClientLogin.status}} <br>User Recordset Status: {{userDetails.status}}

Loaded on form success …

dmx-on:success="userDetails.load();formClientLogin.reset()"

And what’s the reply from the login server action then?

Interesting … the response is correct. Thats what it should be.

So that is correct, why is it not filtering the recordset?

@Teodor, would it help if I send you a zip file of the project in DM?

Could you test with the App Connect update. Add an extra credentials attribute to the serverconnect component. The extra attribute should allow cookies to work with CORS. Also make sure CORS is enabled en a valid origin is entered.

dmxAppConnect.zip (22.6 KB)

1 Like

Thanks @patrick,

I’m about to try this out. Can you explain more about the extra credentials and origin?

Not sure what that means? What kind of credentials and where?

What should the origin be?

On the server connect component add an extra attribute credentials.

<dmx-serverconnect id="serverconnect1" url="/api/action" credentials></dmx-serverconnect>

Origin should be something like http://localhost:12345 for our internal webserver in Wappler. Setting origin to * will allow access from all hosts, but chrome blocks it when used with credentials, not sure on other browsers and with cordova.

Made the changes and no luck. Still. the same. :frowning:

You do have to completely rebuild and recompile your mobile app with the new app connect Brad, so it is included when you test it on your mobile device

  • Previewing in browser it logs in but still doesn’t retrieve the identity. Same as before.
  • Rebuild and test in iOS emulator doesn’t work at all. Even login button does nothing.
  • Interesting: It did work in Android emulator but not iOS
  • Test on iPhone using the QR code doesn’t work at all. Even login button does nothing.

Did you get a cookie inside the browser? iOS is a lot stricter with CORS then Android. The update should at least do something for the browser and android.

In browser, cookies is empty …

Does it set a cookie if you set the remember option in the security provider?

No change … no cookie

Silly question are cookies enabled on the device, or is there something you have to do on an Apple device to manage them?

Does this help:

https://developer.apple.com/documentation/foundation/nshttpcookiestorage

Well, cookies are enabled on my browser.

Not sure about the iPhone. Should run in iOS emulator though?

If I login directly on my API site I get cookies. Does that help?

Using the login you provided these are the only cookies I see created:

We use EditThisCookie (Chrome Extension), very useful: