lepikhinb / momentum-modal

MIT License
442 stars 26 forks source link

Modal component not loaded after login #26

Closed svenvanhees closed 1 year ago

svenvanhees commented 1 year ago

When navigating to the modal url, without an authenticated session, the modal component is not loaded. Instead the login page is still showing. This happens also on the PingCrm example.

Steps to reproduce. Go to https://modal.advanced-inertia.com/contacts/86/edit Login with credentials provided.

We have need of a way to link directly to the modal from an email for example.

To bypass this we have implemented the Modal.php our self and commented out the following line.

    protected function redirectURL(): string
    {
        if (request()->header('X-Inertia-Modal-Redirect')) {
            /** @phpstan-ignore-next-line */
            return request()->header('X-Inertia-Modal-Redirect');
        }

        $referer = request()->headers->get('referer');

//        if (request()->header('X-Inertia') && $referer && $referer != url()->current()) {
//            return $referer;
//        }

        return $this->baseURL;
    }
vpuentem commented 1 year ago

same issue here

lepikhinb commented 1 year ago

Working on it! Thanks