Refresh button on "You were logged out." pop up goes to home instead

AI-generated summary

A bug report was filed regarding the behavior of the “Refresh” button on the “You were logged out.” pop-up, which redirects the user to the home page instead of refreshing the current page. fowl provided steps to reproduce the issue and suggested replacing the logout function with window.location.reload. jomaxro acknowledged the issue, but raised concerns about potential 404 errors if the page was private.

fowl pointed out that private content may still be visible before the button is clicked, suggesting that the page should refresh immediately. However, sam explained that this behavior is by design, considering being logged out as a “super rare” condition that should reset the user to the home page. codinghorror suggested changing the label to “Home” to better reflect the button’s behavior.

fowl noted that the browser’s refresh button works well without losing the user’s place. A pull request (PR) to change the button label has been submitted by jomaxro.

Steps:

  1. Log in
  2. Open another tab of Discourse
  3. Log out
  4. Switch to the other tab to see the above message
  5. Click “refresh”

Actual result:

  1. Redirected to https://meta.discourse.org

Expected results:

  1. Page is refreshed =)

Browser: Firefox 76.0b8

(Also, it seems only the github login only works on the second attempt?)

Relevant code seems to be:

and

Reference to logout function could just be replaced with replaced with window.location.reload?

Behavior here isn’t great, refresh should, well, refresh, not “go home”. That said, I wonder if the implementation is correct, and the button is labeled wrong. If we don’t send people home, refreshing may result in 404 errors, if the page they were on was a PM, secure category, login_required site, etc.

3 Likes

That’s true, although in my case I was reading a bunch of public threads.

Also I guess it may be an issue that if the page was private, in that the that private content is still kinda visible behind the dialog before the button is clicked - so perhaps the page should refresh immediately?

This is certainly by design.

The client has no way of knowing if the topic you were looking is public or not, we could carry a lot of logic here to allow for this, but the way I see it being logged out is a super rare condition and in such a condition it should be thought as a “reset button”.

A “reset button” should take you back to home.

I guess I support changing the label here but I am not sure what we would call it “Refresh to Home Page” is just too long.

3 Likes

I guess change “Refresh” to “Home” then we can close this topic as complete @jomaxro?

2 Likes

The browser “refresh” button works well and doesn’t lose my place if it doesn’t have to. =)

PR is up:
https://github.com/discourse/discourse/pull/9584

4 Likes