statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

Protection scheme [none] is not defined. Denying access to #1217

Open rabol opened 1 week ago

rabol commented 1 week ago

Bug description

Un installing ALT-Password-Protect add-on, will leave a line in the collection like this:

protect: none

That will then result in a 403 when you try to access your site.

I do undertsand that the the 'error' is caused by a 3rd party add-on, however the handling in Statamic could be better

e.g. a better error messages with information on what/where the protection setup was found

A better validation of the collection yaml would also be helpful to ensure that values in the collection yaml is valid.

e.g. the value none is not valid as it is not defined in the config - statamic.protect.schemes

Even if you uninstall the add-on, you will still have the 'Alt password protect' tab when creating or modifying entries in the collection.

How to reproduce

Install the ALT- Password Protect add-on, create a new collection un-install the add-on

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.21.0
PHP Version: 8.3.10
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: raboldev.test
Maintenance Mode: OFF
Timezone: Europe/Madrid
Locale: en

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

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: daily
Mail: log
Queue: sync
Session: file

Statamic
Addons: 3
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.23.0 Solo

Statamic Addons
alt-design/alt-cookies: 1.1.3
alt-design/alt-redirect: 1.3.2
alt-design/alt-seo: 1.1.9

Installation

Starter Kit using via CLI

Additional details

No response

jasonvarga commented 1 week ago

The error is telling you the name of the protection scheme you tried to use, so doing a search in the relevant places should get you there.

I'll move to this to a feature request as there could be a more helpful way to narrow down exactly where to find it.