Laravel redirection into an Iframe on Safari

Viewed 222

I have an Iframe from https://site-a.com/ embeb into https://site-b.com/. For example, the first page of the Iframe is : https://site-a.com/module.

There is a form into the Iframe. When the form has errors, I redirect back with input and errors. redirect()->back()->withErrors(['genericError' => $e->getMessage()])->withInput();

On Safari, this not working, Safari always redirect the user to origin domain : https://site-a.com/ instead of https://site-a.com/module/{previous_url}. When I print URL::previous() on Safari, it returns https://site-a.com/. So, the URL::previous() seems to be incorrect on Safari when we are in an Iframe.

On each other navigators, it's working correctly.

<iframe src="my_url" sandbox="allow-top-navigation allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-forms allow-modals allow-popups"></iframe>

0 Answers
Related