Core: 404 page should allow login

Created on 1 Dec 2015  路  19Comments  路  Source: flarum/core

_1 Upvote_ If a forum is set to members only and you click on a direct link to a post (which may have been posted in IRC, Discord, Email, etc) the user will get a 404 error page instead of a login page.

I think it should redirect to a login page instead.

needs-discussion orkeep typfeature

Most helpful comment

That could help for sure. Give it a flarum looking page with a "This page either does not exist or you do not have access to view it" style message and have a login button of some sort there as well. If they do use that login button it would be nice for it to include a redirect to the link though :)

If all non existent pages and pages needing login point to it - you're not really exposing anything to random people without a login.

All 19 comments

I believe the reason for this behaviour is that we don't want to expose the fact that these discussions exist.

Thoughts, anyone?

My suggestion: close this, behaviour is intended.

I donno :) It's really annoying for many of my users though the way it is now. If they're not already logged in then when they click on the link they just go to a generic error page with no way to login. So they then are just confused and think the link is bad.

Maybe this effects me a lot because my group is mostly in Discord and don't use the forums daily so most of them are not "logged in". Everytime we share a link in chat half the users get error pages. Some of them are savvy enough to just click on the url bar and type in the website. Others just get confused about it. Either way they have to get to the base url of the site, login, then go back to chat to find the original link and click on the link again. It's, well, sort of a pain for them.

Hmm, interesting point. Maybe we should just improve the 404 page, eh?

That could help for sure. Give it a flarum looking page with a "This page either does not exist or you do not have access to view it" style message and have a login button of some sort there as well. If they do use that login button it would be nice for it to include a redirect to the link though :)

If all non existent pages and pages needing login point to it - you're not really exposing anything to random people without a login.

Agreed.

:+1: Awesome.

Merging into #252

Thanks @tobscure, again :)

Re-opening based on feedback in #252

Give it a flarum looking page with a "This page either does not exist or you do not have access to view it" style message and have a login button of some sort there as well. If they do use that login button it would be nice for it to include a redirect to the link though :)

If all non existent pages and pages needing login point to it - you're not really exposing anything to random people without a login

I think this would be the best approach. It's also how other forum scripts handle it.

I have the same problem. In my forum, many users are reporting problems accessing to a forum disscusion from the email notification, because the text "The page you requested could not be found." is confusing. I see two approaches:

  • The message "This page either does not exist or you do not have access to view it" with a button to login seems a quick and easy fix. If the user is already logged, the button to login should be removed.
  • Other workaround might be that the link in the email contains a token to login automatically, but seems a bit more dificult to implement.

Somewhat related to #1305.

Why not just use the standard flarum template (with header and sidebar and etc), but just put the error message in the middle? I don't see the benefit of having error pages without those components, it kinda just strands the user. Regardless of why the page isn't accessible there should be a clear and immediate path to get back to the forum.

This should also solve the issue that Franz linked to.

@flarum/core I would like to propose the following solution for this:

  1. I split the ViewFormatter into a ForumViewFormatter and an AdminViewFormatter. There is precedence for this in the API's use of a JSONApiFormatter
  2. The ForumViewFormatter will display error messages in the main flarum template.
  3. The AdminViewFormatter will largely remain the same, except that the "back to forum" link will link back to the admin page.

The reset password and logout pages have a similar issue, but I would prefer to handle those in #2043

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum.
In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

We are closing this issue as it seems to have grown stale. If you still encounter this problem with the latest version, feel free to re-open it.

Still an issue. When we share the links on social media and users of our forum are not logged in, they just find a 404 error and leave, instead of being redirected to a log in page.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ralkage picture Ralkage  路  4Comments

MichaelBelgium picture MichaelBelgium  路  4Comments

datitisev picture datitisev  路  4Comments

luceos picture luceos  路  3Comments

datitisev picture datitisev  路  3Comments