diff --git a/src/admin/components/Routes.tsx b/src/admin/components/Routes.tsx index 0eebdaaa36..58863f2fb2 100644 --- a/src/admin/components/Routes.tsx +++ b/src/admin/components/Routes.tsx @@ -21,6 +21,7 @@ const Edit = lazy(() => import('./views/collections/Edit')); const EditGlobal = lazy(() => import('./views/Global')); const ResetPassword = lazy(() => import('./views/ResetPassword')); const Unauthorized = lazy(() => import('./views/Unauthorized')); +const UnauthorizedUser = lazy(() => import('./views/UnauthorizedUser')); const Account = lazy(() => import('./views/Account')); const Routes = () => { @@ -75,9 +76,12 @@ const Routes = () => { - + + + + {collections.map((collection) => { if (collection?.auth?.verify) { diff --git a/src/admin/components/views/UnauthorizedUser/index.scss b/src/admin/components/views/UnauthorizedUser/index.scss new file mode 100644 index 0000000000..7abc1764ad --- /dev/null +++ b/src/admin/components/views/UnauthorizedUser/index.scss @@ -0,0 +1,15 @@ +@import '../../../scss/styles.scss'; + +.unauthorized-user { + &__plan-name { + text-transform: capitalize; + } + + &__button-group { + display: flex; + + > *:first-child { + margin-right: base(.5); + } + } +} diff --git a/src/admin/components/views/UnauthorizedUser/index.tsx b/src/admin/components/views/UnauthorizedUser/index.tsx new file mode 100644 index 0000000000..c969550fc5 --- /dev/null +++ b/src/admin/components/views/UnauthorizedUser/index.tsx @@ -0,0 +1,68 @@ +import React from 'react'; +import { useAuth, useConfig } from '@payloadcms/config-provider'; +import Button from '../../elements/Button'; +import Meta from '../../utilities/Meta'; +import Banner from '../../elements/Banner'; +import MinimalTemplate from '../../templates/Minimal'; +import X from '../../icons/X'; + +import './index.scss'; + +const baseClass = 'unauthorized-user'; + +const UnauthorizedUser: React.FC = () => { + const { licenseType, user } = useAuth(); + const { + routes: { + admin, + }, + } = useConfig(); + + return ( + + +

Your user account is unauthorized

+ } + > + Sorry, the + {' '} + + {licenseType} + + {' '} + license associated with this domain does not grant access to your email address ( + {user?.email} + ). + +

+ Don't worry—your Payload API is still accessible, but you can only access the Payload admin panel with user(s) that are specifically whitelisted by the owner of this Payload license. +

+

The user accounts that are granted access can be configured within the Payload CMS website. Contact the owner of the license to learn more.

+
+ + +
+
+ ); +}; + +export default UnauthorizedUser; diff --git a/src/admin/components/views/Unlicensed/index.tsx b/src/admin/components/views/Unlicensed/index.tsx index 9031caee08..b4559f43b2 100644 --- a/src/admin/components/views/Unlicensed/index.tsx +++ b/src/admin/components/views/Unlicensed/index.tsx @@ -33,6 +33,7 @@ const Unlicensed: React.FC = () => (