
Question:
I'm using TYPO3 7.6 LTS
with the Systemextension felogin
.
Everything works fine. FE-Users use a login to visit my website.
Now, I want to send a link via e-mail to some users - like a deeplink, f.e. example.org/index.php?id=123
. They should click the URL (pid=123), FE-login (pid=1) and TYPO3 should redirect to page 123.
I thought I'm using <strong>referer</strong> but it's not working? RSA is still working fine. I use the standard template from Ext:felogin
.
Did I forgot something?
My Typoscript:
config.typolinkLinkAccessRestrictedPages = 1
config.typolinkLinkAccessRestrictedPages_addParams = &referer=###RETURN_URL###
plugin.tx_felogin_pi1 {
storagePid = 27,15
#templateFile = EXT:myext/Resources/Private/Extensions/Felogin/Templates/FrontendLogin.html
showForgotPasswordLink = 1
#showPermaLogin =
forgotLinkHashValidTime = 12
newPasswordMinLength = 4
### redirect options
redirectMode = referer
redirectFirstMethod = GET
redirectPageLogin = 2
redirectPageLoginError = 1
redirectPageLogout = 1
# disable redirect with one switch
redirectDisable =
# Show logout form direct after login
showLogoutFormAfterLogin = 0
}
Flexform: nothing! Everything via TS, but it won't work ...
Frontend HTML:
<form action="/" target="_top" method="post" onsubmit="; return true;">
...
<div class="felogin-hidden">
<input type="hidden" name="logintype" value="login" />
<input type="hidden" name="pid" value="15,27" />
<input type="hidden" name="redirect_url" value="" />
<input type="hidden" name="tx_felogin_pi1[noredirect]" value="0" />
</div>
Answer1:Just specify the redirectFirstMethod
Methods. This feature requires the GETvar "referer" to be set to the page you want the user to return to after login. For more detalis reffere this link <a href="https://wiki.typo3.org/Felogin" rel="nofollow">felogin</a>
plugin.tx_felogin_pi1 {
redirectMode = referer
redirectFirstMethod = GET
}
config.typolinkLinkAccessRestrictedPages = 1
config.typolinkLinkAccessRestrictedPages_addParams = &referer=###RETURN_URL###
Answer2:As mentioned in the <a href="https://docs.typo3.org/typo3cms/extensions/felogin/Examples/Index.html" rel="nofollow">FElogin manual</a>, the FElogin extension cannot handle deep links by itself:
<blockquote>If visitors will directly enter the URL of an access restricted page they will be sent to the first page in the rootline to which they have access. Sending those direct visits to a login page is not a job of the felogin plugin, but requires a custom page-not-found handler.
</blockquote>A custom page-not-found handler is for example the extension <a href="https://extensions.typo3.org/extension/pagenotfoundhandling/" rel="nofollow">'pagenotfoundhandling'</a>.
Once you have installed the extension, go to the extension settings and set the UID of your login form page as 'Standard 403 Page' and save.
Now, whenever a user goes to an access-restricted page using a deeplink, he will be redirected to the login page - however the URL will remain as the URL of the deeplink. As a result the user is redirected to the correct page after login.
Credit to <a href="https://stackoverflow.com/users/2683462/bharat-parmar" rel="nofollow">Bharat</a> for originally coming up with this solution in another <a href="https://stackoverflow.com/a/32697174/5726546" rel="nofollow">thread</a>.