Skip to content

multisite system messages: {{ link }} not only for primary domain, but for all #3029

@monchito

Description

@monchito

Description

The siteId of the primary site is explicitly passed in when generating {{ link }} urls (e.g. as password reset link, account activation, etc. in a system message). The code is here:

https://github.com/craftcms/cms/blob/develop/src/services/Users.php#L1079-L1081

This is because all users are 'global' within the same craft install.

Makes sense, from a developers' point of view. But less for users imho

This creates unwanted behaviour when applied to a multisite setup like mine (and hopefully others as well :p), that currently has 3 domains and 4 'sites' (1 domain has two languages). The 3 domains have different looks and feels.

And in particular: 1 domain (which is not the primary domain) does something for a specific usergroup that doesn't do anything with the other domains.

Steps to reproduce

  1. So when a user signs up on my custom registration form
  2. they are added to this specific user group
  3. receive the email activation link, but are thus sent to another domain with (slightly) another look and feel
  4. complete the activation process there
  5. and are then redirected to the homepage of the primary domain. In short: they are lost.

They should:

  1. receive an activation email with a {{ link }} that points to the domain where they signed up
  2. and upon activation
  3. they should be redirected to a page on that domain, not a completely other (in their point of view, they don't know or care about the way my database is structured)

So I think it would be a nice feature if system messages optionally become multisite-aware. By default the primary domain is used, unless for a specific site I don't want to

Additional info

  • Craft version: pro 3.0.12
  • PHP version: 7.1
  • Database driver & version: mysql
  • Plugins & versions: for the signup / registration process: a custom plugin that hooks into craftcms default behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimprovements to existing featuresuser management 😇features related to user management

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions