You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Installer: Hyvä step stores the project key as the Composer username and picks the theme with an unordered LIKE #436
bin/magento install, choosing the Hyvä theme with a Hyvä project key and API token
Steps to reproduce
Run bin/magento install and pick Hyva as the theme.
Enter the project key and API token from your hyva.io account.
Finish the installation and check auth.json and the theme that is applied to the default scope.
Expected result
auth.json holds the credentials in the form Hyvä documents: composer config --auth http-basic.hyva-themes.repo.packagist.com token <license key>. That is, the username is the literal token and the password is the key.
The installer applies Hyva/default.
Actual result
Found by reading the 4.0.0 code and comparing it with Hyvä's installation docs. I haven't run it against Hyvä's repository.
Credentials:ComposerAuthManager writes the project key as the username and the API token as the password (ComposerAuthManager.php#L44-L48). That differs from Hyvä's documented setup, where the username is token. If Private Packagist checks the username, composer require hyva-themes/magento2-default-theme fails with an authentication error and the wizard falls back to Luma.
Theme selection:ThemeConfigurer looks the theme up with SELECT theme_id FROM theme WHERE area = 'frontend' AND theme_path LIKE '%hyva%' LIMIT 1, without ORDER BY (ThemeConfigurer.php#L102-L105). When more than one registered theme path contains hyva (for example a Hyvä child theme in app/design, Hyva/default-csp, or Hyva/reset on older Hyvä versions), the result is whichever row MySQL returns first.
Additional information
Possible fixes:
write 'username' => 'token', 'password' => $apiToken, and keep the project key only in the repository URL;
look the theme up by its exact path (Hyva/default, taken from the theme registry) instead of LIKE.
Found while documenting the installer for the devdocs (mage-os/devdocs#110).
Triage and priority
Severity: S3- Affects non-critical data or functionality and does not force users to employ a workaround.
Activity