Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout: fix redirect #3304

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open

Conversation

XhmikosR
Copy link
Contributor

@XhmikosR XhmikosR commented Mar 9, 2025

Without this, we were getting into a loop with keep alive enabled

/CC @DL6ER to test it out and squash when merging if it LGTY.


Thank you for your contribution to the Pi-hole Community!

Please read the comments below to help us consider your Pull Request.

We are all volunteers and completing the process outlined will help us review your commits quicker.

Please make sure you

  1. Base your code and PRs against the repositories developmental branch.
  2. Sign Off all commits as we enforce the DCO for all contributions
  3. Sign all your commits as they must have verified signatures
  4. File a pull request for any change that requires changes to our documentation at our documentation repo

What does this PR aim to accomplish?:

How does this PR accomplish the above?:

Link documentation PRs if any are needed to support this PR:


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

@DL6ER
Copy link
Member

DL6ER commented Mar 9, 2025

I don't see a loop but I do see a long delay until the logout finally succeeds. This seems to be a (Firefox?) browser issue as FTL sees the logout request immediately, terminates the session accordingly and replies with 204. This can be seen in the Network Overview (Dev Tools) tab, what we can also see is that the browser then hangs trying to (re)load the page to get to the login page. However, this request never arrives at the web server (confirmed by an independent tcpdump), so it really is a client-side issue. So far, so good.

However, I don't think the first approach in this PR (static redirect) is the right solution. Mostly because of #3269 where we are currently trying to get rid of any hard-coded paths very like the one you are adding here. But if this is really the only option here, I will find a solution for #3269 and we don't have to worry about it here.

@yubiuser
Copy link
Member

yubiuser commented Mar 9, 2025

This seems to be a (Firefox?) browser issue

Agree. No issues to logout using Chrome, this is instant. But Firefox loops

Copy link
Contributor

github-actions bot commented Mar 9, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@mwoolweaver
Copy link

mwoolweaver commented Mar 9, 2025

i did some testing with the development branch in this regard (logout loop with firefox)

If the tab with Pi-hole is the focus, the page loops forever.

If the tab with Pi-hole is not the focus, the logout succeeds quicker (not as fast as chrome). (click logout then switch to a different tab)

also worth noting is the logout happens without a loop, still not as fast chrome, when deleting the SID from this page https://pi.hole/admin/settings/api for the current session (highlighted)

Copy link
Contributor

github-actions bot commented Mar 9, 2025

Conflicts have been resolved.

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Mar 9, 2025 via email

@XhmikosR XhmikosR force-pushed the patch-3 branch 3 times, most recently from ca1f186 to 345d271 Compare March 23, 2025 05:43
@XhmikosR XhmikosR marked this pull request as ready for review March 23, 2025 05:43
@XhmikosR
Copy link
Contributor Author

XhmikosR commented Mar 23, 2025

Login might take a long time on Firefox too. There might be more places that we need to be explicit with the location.reload...

For example, logout and then manually change the URL in the browser to something that requires authentication, like /admin/settings/system.

@DL6ER
Copy link
Member

DL6ER commented Mar 23, 2025

I agree with what this PR is doing and it tests okay. However, I wonder if @rdwebdesign is right and we should instead add this here:

<body class="<?=theme.name?> hold-transition sidebar-mini <? if pihole.boxedlayout() then ?>layout-boxed<? end ?> logged-in" data-apiurl="<?=pihole.api_url()?>">

Just in case we want/need to reuse it in the future.

@XhmikosR
Copy link
Contributor Author

I don't mind moving it to body but right now is unneeded. Can be moved later if needed or let me know and I can move it in this branch.

@XhmikosR
Copy link
Contributor Author

My main concern is that there might be more places this might be needed, see my previous comment.

Without this, we were getting into a loop with keep alive enabled
when using Firefox.

Signed-off-by: XhmikosR <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants