Skip to main content

[Solved] Custom Login for FluentCommunity Not Working Properly

I installed FluentCommunity on a subdomain and moved it from /portal/ to / (root). That worked fine. Great!

Then, I set the Portal Access Settings from "Everyone" to "Only Logged In Users", and once a public user gets onto the root (community.example.com) they were presented with the default login screen. Great!

However, I want a custom login, so I set the "Custom Login/Signup Form Type" to "Use Custom Login Page" and entered my URL: sso.example.com/login. This always redirects to community.example.com/wp-login.php?redirect_to=https%3A%2F%2Fcommunity.example.com%2Fwp-admin%2F&reauth=1

Any "custom" URL on the same domain works fine, but as soon as I enter an URL with a different domain (here a different subdomain), it falls back to the above aka not working.

If there is not a real good reason for that, can you please fix that?

Shahjahan Jewel

We use WordPress safe redirect for security maybe that’s the problem. I will check and see how we can give you a hook so you can disable that redirect security check.

AndrΓ© Daus

Shahjahan JewelΒ that explains it! And it is even better than I hoped for. You are using standard Wordpress behavior. And so I can get around it with standard Wordpress filters also. So I added the following script to FluentSnippets:

add_filter('allowed_redirect_hosts', function ($hosts) {
    $hosts[] = 'sso.example.com';
    return $hosts;
});

There is nothing to fix. But maybe, you can add this to the docs?

Perfect. Thanks!