studio1902 / statamic-peak

Statamic Peak is an opinionated starter kit for all your Statamic sites.
GNU General Public License v3.0
585 stars 101 forks source link

users.php config file has diverged from Statamic core #392

Closed steveparks closed 2 months ago

steveparks commented 2 months ago

Bug description

I've experienced issues with password resets in my Peak-powered site.

I installed Peak into an existing, but clean, Statamic 5.x site.

It appears that Peak has its own version of /config/statamic/users.php, and that it overwrites the core one.

The Peak version includes these lines for the Reset Broker config:

    'passwords' => [
        'resets' => 'resets',
        'activations' => 'activations',
    ],

That's similar to the version Statamic CLI installs into a clean site:

     'passwords' => [
        'resets' => 'users',
        'activations' => 'activations',
    ],

Similar, but instead of setting 'resets' to 'users' it sets it to 'resets'. That seems to be just enough to break password resets.

Meanwhile, the Statamic repo has these lines in the config file for 5.x:

    'passwords' => [
        'resets' => config('auth.defaults.passwords'),
        'activations' => config('auth.defaults.passwords'),
    ],

There are two approaches to resolving this I think:

1) is there a need for Peak to have its own users.php config file? I couldn't see any Peak specific settings in there. Maybe it could be removed from Peak and just leave the Statamic core version?

2) If Peak needs its own version, then it could be updated, ideally to the same as the 5.x repo version.

Because there's a choice (and maybe things I've missed), I'm holding off doing a PR - but will happily do one if that's useful once you decide what direction is best.

How to reproduce

  1. Install a clean Statamic 5.x site with the CLI. Check users.php

  2. Install Peak starter kit on that site. Check users.php

  3. Check the Statamic/cms 5.x repo users.php

Logs

No response

Environment

Environment
Application Name: Convivio
Laravel Version: 11.10.0
PHP Version: 8.3.8
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: convivio2.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 6
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.7.3 PRO

Statamic Addons
studio1902/statamic-peak-browser-appearance: 3.5.0
studio1902/statamic-peak-commands: 8.3.1
studio1902/statamic-peak-seo: 8.14.0
studio1902/statamic-peak-tools: 6.1.0
tv2regionerne/statamic-passport: 1.4.1
tv2regionerne/statamic-private-api: 1.14.0

Additional details

No response

robdekort commented 2 months ago

Thank you. There used to be a need for a custom users.php but not anymore. I'll remove it from the kit.