Error after SSO logout

AI-generated summary

Users reported an error after SSO logout when ‘Unread’ was set as the default forum view: anonymous users were redirected to a page requiring login, triggering the error “You have to be logged in.” Falco suggested setting a safe logout redirect (e.g., forum root), which resolved the issue for Lutz. sam confirmed that logging out from ‘Unread’ on try.discourse.org redirects to root, but Falco clarified that setting ‘Unread’ as default breaks for anonymous users since unread topics don’t exist for them. sam noted this configuration isn’t officially supported unless the forum requires login. Lutz found that redirecting logout to ‘latest’ avoids the error and suggested adding a warning in the admin panel or auto-redirecting anonymous users from ‘Unread’ to ‘latest’—though not urgent, as workarounds exist. sam mentioned validation already prevents ‘Unread’ from being first in the menu and users can choose a different homepage.

If I do a logout I get the following Error:

If I click on the link its says:
“{“errors”:[“Dazu musst du angemeldet sein.”],“error_type”:“not_logged_in”}”

(translation;: You have to be logged in.)

Oh and Unread is the default View for the forum. If I change it back, it works.

Did you try setting logout redirect somewhere safe like the forum root ?

That solved it, thank you very mutch!

I am confused, I just tried:

  1. visiting unread on try.discourse.org
  2. logging out
  3. I was redirected to root.

Is the issue here that you set an invalid logout redirect?

Sam, set Unread to the default forum view and logout. It breaks, probably because there is no unread for anon. I can take a look at it.

well, don’t do that… that is not really a supported configuration, would only be sort-of-supported on “Requires login” forums.

I set the logout redirect to forum/latest there is no error. Error comes back, if you are going to visit the forum without being logged in. After thinking about it, I changed the default view back to latest. Otherwise no guests could read the forum.

I still have no real insight (working on it) - but maybe it is possible to add a warning text at the admin panel not to put unread first. Or maybe its is even possible to do an redirect from unread to latest or the second configured view, if you are not logged in? It’s not urgent at all since there is a workaround for it.

I believe we added validation to ensure unread is never first in the menu. Plus users can pick a different home page if they wish today.

How is stuff going?