This PR aims to fix a few issues with the notFound page and custom views so it matches v2 behaviour: - Non authorised users should always be redirected to the login page regardless if not found or valid URL - Previously notFound would render for non users too potentially exposing valid but protected routes and creating a confusing workflow as the UI was being rendered as well - Custom views are now public by default - in our `admin` test suite, the `/admin/public-custom-view` is accessible to non users but `/admin/public-custom-view/protected-nested-view` is not unless the checkbox is true in the Settings global, there's e2e coverage for this - Fixes https://github.com/payloadcms/payload/issues/8716
14 lines
253 B
TypeScript
14 lines
253 B
TypeScript
import type { GlobalConfig } from 'payload'
|
|
|
|
import { settingsGlobalSlug } from '../slugs.js'
|
|
|
|
export const Settings: GlobalConfig = {
|
|
slug: settingsGlobalSlug,
|
|
fields: [
|
|
{
|
|
type: 'checkbox',
|
|
name: 'canAccessProtected',
|
|
},
|
|
],
|
|
}
|