What happened?
Description
We have a multi-site that powers two different domains. As per the single domain condition and the license enforcement guidelines, authors are instructed to only log into the Control Panel through the primary domain. However, some authors will occasionally log in through the alternate domain (when they're viewing the alternate site, it's natural to append /admin to the domain as normal). This shows a warning at the top of the Control Panel about the license being tied to a different domain, as expected. That's also a nice nudge for authors to remember to log in through the primary domain.
This problem is that this warning and/or the license check is cached and then also shown to authors that correctly log in through the primary domain. This results in this incomprehensible (and also very funny) warning:

Clearing all caches will remove this warning. Maybe the cache needs to include the current domain in the cache key?
Steps to reproduce
- Create a multi-site with two different domains, both of which are subject to license enforcement, and add a valid license tied to one of the domains.
- Log out of the admin account, clear all caches through the CLI, then log in by visiting the Control Panel through the secondary domain that doesn't match the licensed domain.
- Wait until the error about the CMS license is displayed at the top.
- Open the Control Panel through the primary domain and log in again.
Expected behavior
The warning about the license not matching the domain should only be displayed if the current URL actually does not match the licensed domain.
Actual behavior
The warning may be displayed for users logging in through the correct and licensed domain.
Craft CMS version
5.4.8
PHP version
8.3
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
What happened?
Description
We have a multi-site that powers two different domains. As per the single domain condition and the license enforcement guidelines, authors are instructed to only log into the Control Panel through the primary domain. However, some authors will occasionally log in through the alternate domain (when they're viewing the alternate site, it's natural to append
/adminto the domain as normal). This shows a warning at the top of the Control Panel about the license being tied to a different domain, as expected. That's also a nice nudge for authors to remember to log in through the primary domain.This problem is that this warning and/or the license check is cached and then also shown to authors that correctly log in through the primary domain. This results in this incomprehensible (and also very funny) warning:
Clearing all caches will remove this warning. Maybe the cache needs to include the current domain in the cache key?
Steps to reproduce
Expected behavior
The warning about the license not matching the domain should only be displayed if the current URL actually does not match the licensed domain.
Actual behavior
The warning may be displayed for users logging in through the correct and licensed domain.
Craft CMS version
5.4.8
PHP version
8.3
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions