Hi,
I wrote a message 2 weeks ago in the “Support” category (Login page "/login" show "no configured method" - #2 by kev-is-coding-for-adn ) but no one seems to have an answer for me.
Because I think this is a bug, I will post it here.
My setup is simple :
Login required is enabled
Discourse Connect is enabled (and working)
Local logins and Local Logins by emails are disabled
From an anonymous session, if I go to the home page of my community (https://community.adn-soft.com ), it will show the main page with the button to “Log In”. But if I want to go directly to any targeting page (https://community.adn-soft.com/t/test-categories-sujet-et-etiquette/69 ), I’m redirected to the “/login” page which says “No login methods”.
From my point of view, because I have only 1 login methods configured (Discourse Connect ), it should directly use it, or at least show the login page like the home page.
I think that instead of redirecting to “/login”, it should redirect to “/login-required”.
Is there something I’m doing wrong ?
Thanks for your help
Kevin
zogstrip
(Régis Hanol)
July 10, 2025, 5:01pm
4
Tried locally and it worked fine.
As soon as I enter the topic page as “anon” I’m being redirected to the /sso endpoint which then redirects to the local “discourse connect ” I have setup & configured (on localhost:5000).
When I try https://community.adn-soft.com/t/-/69
I’m being redirected to the /login endpoint
Looking at the code, and especially the redirect_to_login
callback, I can see we’ll only redirect to the /sso endpoint when both “discourse connect ” is enabled as well as the “auth immediately” site setting
raise Discourse::InvalidAccess.new unless SiteSetting.wizard_enabled?
end
def destination_url
request.original_url unless request.original_url =~ /uploads/
end
def redirect_to_login
dont_cache_page
if SiteSetting.auth_immediately && SiteSetting.enable_discourse_connect?
# save original URL in a session so we can redirect after login
session[:destination_url] = destination_url
redirect_to path("/session/sso")
elsif SiteSetting.auth_immediately && !SiteSetting.enable_local_logins &&
Discourse.enabled_authenticators.length == 1 && !cookies[:authentication_data]
# Only one authentication provider, direct straight to it.
# If authentication_data is present, then we are halfway though registration. Don't redirect offsite
cookies[:destination_url] = destination_url
redirect_to path("/auth/#{Discourse.enabled_authenticators.first.name}")
else
By default, that site setting is enabled, but when I disable it, then
So my guess is that you have that site setting disabled and you should enable it to make it work
Note: I’m not entirely sure why this site setting exists, but I’m in the process of getting rid of it along with a bunch of other auth-related fix.
1 Like
Yes, you’re completly right.
But if I enable this behavior, then I don’t have any home page anymore.
Just for you to see, I have activated it right now.
If you go to https://community.adn-soft.com , it will directly redirect to the sso provider without showing home page.
Edit : I just put it back to the previous state because I need this home page