-
-
Notifications
You must be signed in to change notification settings - Fork 213
Redirect to last page after frontend login bug? #8632
Comments
|
Sounds like a bug to me. Is it also reproducible in the current Contao demo? |
|
I just checked the ModuleLogin.php to check what happens. But in the: I used this now: I presume, there is a "cleaner" way but this would be my idea. What do you think? |
|
And to your question yes it is, in Contao 3.5.24 and the version 4 demo. |
This should actually suffice (in theory). It checks if there is a POST request and if there is, it does not set the |
|
Entering wrong login data can only be checked by the backend so it must be passed back to php via the POST Request, so i think that check doesn't work for this case. |
|
Well yes of course. When you send the login data, you send a POST request. In that case the |
|
Maybe empty($_POST) would be better? It should recognize the empty array() that is being returned more safely. Although that would solve the posting the wrong data problem, still if you reload the page or timeout and your browser does it for you, no POST ist sent and the login-page is set as last_page_visited... |
|
Is this issue related to #8324? |
|
No, it is not. To sum it up: |
|
|
|
@contao/developers /cc |
|
I'm sorry you are right, of course it is. The problem still exists after adding empty(); What i had to do ist add Code inside the if statement because it seems the POST Value Check is not working. You can test it:
I solved it by adding a second check inside your statement, like this: |
|
As discussed in Mumble on March 23rd, we must not set the last page visited if the referrer is the same as the current URL here. (Mind the |
|
Fixed in 8c92d98. |
# Contao calendar bundle change log ### 4.3.8 (2017-04-24) * Correctly use the en dash in the calendar modules (see contao/core#8690). * Correctly support 64 character template names everywhere (see contao/core#6819). # Contao comments bundle change log ### 4.3.8 (2017-04-24) * Correctly support 64 character template names everywhere (see contao/core#6819). # Contao core bundle change log ### 4.3.9 (2017-04-25) * Revert the Punycode library changes (see contao/core#8693). ### 4.3.8 (2017-04-24) * Inline small images in protected folders in the file manager (see #636). * Correctly encode the URL in the DataContainer::switchToEdit() method (see #762). * Fix the parent view drag and drop in Firefox (see #666). * Correctly display the search results in the extended tree view (see #739). * Update the Punycode library to version 2 (see #748). * Fix the "delete file" button for non-admin users (see #764). * Prevent endless loops in the book navigation module (see contao/core#8665). * Limit the maximum size of dimensionless SVGs in the back end (see contao/core#8684). * Correctly support 64 character template names everywhere (see contao/core#6819). * Remove the UTF-8 BOM when combining files (see contao/core#8689). * Correctly move folders with an "@" in their name (see contao/core#8674). * Correctly redirect to the last page visited upon login (see contao/core#8632). ### 4.3.7 (2017-03-23) * Check the database connection in the WebsiteRootsConfigProvider class. * Fix the %2B conversion in the Controller::addToUrl() method. # Contao listing bundle change log ### 4.3.8 (2017-04-24) * Correctly support 64 character template names everywhere (see contao/core#6819). # Contao news bundle change log ### 4.3.8 (2017-04-24) * Correctly support 64 character template names everywhere (see contao/core#6819). # Contao newsletter bundle change log ### 4.3.8 (2017-04-24) * Correctly support 64 character template names everywhere (see contao/core#6819).
I'm not shure if this is the correct behavior or not, so i will just explain myself.
Reproduction:
Create a login page and set the redirect option to: last page
Create a new page and create a link to the Login-Page.
Now visit the new page and click on the login-link.
Enter wrong login data and then correct login data (what definitely could happen in real life).
Now you are not correctly redirected, in my case, the login page stays put as it now is the last page, but the login form disappears, which resolves in a empty page.
I will try and build a workaroun for my case.
Do you also see this as a bug or at least not optimal?
I haven't looked at the redirect creation process yet, but i would suggest to check, if the newly to be set last page is the same as the current page, if so, don't overwrite the existing entry.
Normally people want to go to the last page anyway and are annoyed if they have to click "back" twice not?
Not shure if this would affect to many other situations.
Thanks for your feedback in advance
The text was updated successfully, but these errors were encountered: