#404 error on page that works fine in browser

1 messages ยท Page 1 of 1 (latest)

silver oasis
#

Re: nativephp/ios

Initial install of Laravel 12 with Livewire. Registering an account, logging in, and logging out all works fine when trying it via browser. Now, when running in the iOS simulator, only registering and logging in work. When I log out, I get a 404 page with these errors in the debugger:

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:]  Can only perform input operation for an active session. sessionID = 864EB6A4-4680-4D92-ABAC-71C152B20B7E```
willow topaz
#

These warnings in Xcode are unrelated - RTIInputSystemClient is Apple's private framework for sharing text input between your host system and the simulator. You can ignore these for now

willow topaz
#

The 404 issue suggests that the logout route isn't mapping correctly. I'll investigate, but if you can find the POST /logout entry in the Xcode debug log, that may help

flat silo
#

I think this was the error I was hitting @willow topaz and if so, I have a good way of replicating.

#

At least it sounds related.

willow topaz
#

Feel free to share any info here

flat silo
#

I believe there may be a bug in the way the iOS app handles redirects.

If we look at the request log in Xcode, we usually see GET / or perhaps POST /logout however, if that controller method has lets say a return redirect()->route('login);, the next request in xcode will show GET php://127.0.0.1/ or GET php://127.0.0.1/login which in turn causes a 404.

#

Happy to demonstrate over Tuple when and if theres time

#

Just had a thought on a workaround, which I'm going to test.

#

My workaround did not work... In my test app, I have a Middleware that utilises (for this test):

return redirect('/'); // Tried this to force a relative redirect

As you'll see from the log below, we do an initial request to GET / and subsequently, GET /settings where I trigger a biometric auth... After 3 failed attempts, a redirect to / is provided where you'll see the request is GET php://127.0.0.1 instead. I think it's URL mutation.

silver oasis
#

Thank you guys. This does look related. Here is what I'm seeing in the logs (now that I know what I'm looking for, lol)

iron cloud
#

I was actually hitting the same thing using Inertia the other day. Pretty sure I was attempting to redirect. Does this mean any redirects aren't working?

flat silo
#

Yeah, redirects are currently failing but direct links via anchor tags are just fine.

#

Based on what I see in Xcode, and my limited understanding of Swift, I think it's related to the native HTTPURLResponse and how that's handling the Location header. I think Simon may need to add a check and adjust before passing it through.