Sometimes, in our AppGini applications we'd like to share data with co-workers or other users by sending a link via email, for example. Unfortunately, this does not work as expected, by default.
AppGini default behaviour
By default, if we are not logged in already, AppGini redirects us to the login-page first, then to the homepage (
index.php) after login.
This means the user will not see the requested page unless he/she clicks the link again (or copies the url into the browser's address bar).
But this is not what we want at all. We'd like to redirect the user to the requested page after login, not to the homepage.
What we want is, when the recipient clicks the link, his/her browser should open up and show the shared page after login.
Please note that this is BETA for testing purposes. Please provide feedback if this works for you or not.
We have done all the hard work for you and provide a simple solution:
<!-- file: hooks/header-extras.php --> <script> var common = new AppGiniCommon(); common.autoRedirect(); </script>
That's all you have to do. Just call the
autoRedirect() function on the AppGiniCommon object. Our library will do the rest.
Wanna see it in action?
This integrates nicely with QR-Codes