php - Laravel return redirect not working in iOS container
This is a bizarre one. I have a laravel app running fine. It all works as intended, on desktop and mobile safari.
I started experimenting yesterday with wrapping it in an iOS container and was pleasantly surprised with the results, however there was one really odd bug.
When going through the signup for there was one form button that wouldn't submit.
Debugging revealed that this was the first button that used a
redirect('/route')
as opposed to a
return('view')
Here is the code in my Laravel controller
public function confirmpin(Request $request)
{
$pin = Auth::user()->pin;
if ($pin == $request->pin)
{
return redirect('/gateway');
} else
{
echo "Wrong PIN";
}
}
If I deliberately enter the wrong pin then it does echo out "Wrong PIN" but if I enter the correct pin the redirect doesn't happen. I have tested this elsewhere in the app with a database update. I see the update happening in the DB but the redirect doesn't happen.
In iOS land, my web view code is as follows:
@IBOutlet weak var webview: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let myURL = URL(string:"https://XXXXXX.net/index")
var request = URLRequest(url: myURL!)
webview.load(request)
}
It's a real pain.
FYI I have also tried changing the route to a named route and expressing that as such:
redirect()->route('gateway')
Which didn't work either.