Redirect /login to /auth/ldap

We support only one login method via LDAP. Currently, when user logs out, he is sent to page our.domain/login which looks like this (screenshot from my test server in virtualbox, hence the url and https warning):

Clicking on log in sends the user to our.domain/auth/ldap/:slight_smile:

Is there a way to make this redirect automatic so user would never see the first screen (which in our use case does not bring any value)?

(a bonus question would be how to customize the latter screen to include a link for password reset)

Edit: clearly I am not the only one interested: Custom login permalink

1 Like

Discourse has a setting to automatically redirect to external provider, but it doesn’t affect the ‘/login’ page since it’s a “static” page.

I think is auth immediately

2 Likes

In the end I put this:

# Permanent redirect to an individual page
rewrite ^/login$ http://mydomain.tld/auth/ldap permanent;

to
/etc/nginx/conf.d/mydomain.tld.d/redirect.conf

I am running Discourse on Yunohost, so it is run through nginx. Would be nice if Discourse did this automatically:-).

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.