With two domains set up, and a user's 'Domain Access' field set to only one of them, that user is still able to use the login form on both domains.

Is this a feature that's not yet implemented on D8, or was it simply never a feature of this module?

(And if it was never a feature of this module, would you be interested in a submodule implementing it, or prefer it as a separate contrib module?)

Comments

joachim created an issue. See original summary.

guilhom’s picture

Hello joachim,

I had the same problem with my Drupal site running Domain Access and the only solution I found was to alter the user_login form and add a new validation function to check if the assigned domains for the current user matches the current domain.

I don't know if there was a better solution, but that one worked for me.

Appreciate if someone comes with a more elegant solution.

Renee S’s picture

(nmd)

agentrickard’s picture

Category: Support request » Feature request

It's a feature not yet implemented, though I don't believe this specific feature was ever in the main module suite.

We generally don't do much with logins, as the restrictions are hard to enforce. If you can define what the behavior should be for registering new users, it could be developed as a new module.

joachim’s picture

> If you can define what the behavior should be for registering new users, it could be developed as a new module.

Do you mean that if users can freely register new accounts, then restricting login is pointless?

Given that, I think the thing to do would be that this new module would need to warn site admins that there's no point in restricting login to a given domain unless account creation is restricted either globally, or on that domain using domain_config.

agentrickard’s picture

That is my concern, yes. There are multiple ways to assign domains on account creation, and handling that would have to be part of the feature definition.

agentrickard’s picture

Status: Active » Closed (works as designed)