Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

"admin.components.AfterLogin" is not allowed

default discord avatar
rae8844last year
2

Hi! I'm working on a Payload project and excited to be using this CMS for the first time. Any insight into why I wouldn't be able to add a BeforeLogin or AfterLogin to my

payload.config.ts

file?



Here's the relevant code:



admin: {
    css: path.resolve(__dirname, 'styles/main.scss'),
    components: {
      BeforeLogin: CustomBeforeLogin,
      graphics: {
        Logo: CustomLogo,
      },
      Nav: CustomNav,
      providers: [CustomProvider],
      views: {
        Dashboard: CustomDashboard,
      },
    },
  },


And the error I'm getting is

"admin.components.AfterLogin" is not allowed

I figure I'm probably missing something obvious -- thanks for the help!

  • discord user avatar
    tylandavis
    last year

    hey

    @633673700373299221

    , the config is case sensitive, so you should use

    beforeLogin

    and

    afterLogin

    . Also you'll need to pass them in as an array:



    admin: {
      components: {
        beforeLogin: [
          // components go here,
        ],
        afterLogin: [
          // components go here,
        ],
      },
    },


    Let me know if you run into any more issues!

  • default discord avatar
    rae8844last year

    Thank you!!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.