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.

Unable to login

default discord avatar
sasuke14120last year
2

I added a custom endpoint

/users/login

for login on Front-end though it is working fine, I'm unable to use

/admin

for login using payload-cms. Can someone help me with this?



attached code reference as an image.



  • discord user avatar
    dribbens
    last year

    By adding a custom endpoint that is already one that payload adds for you are effectively replacing the

    /login

    endpoint with your own.


    If you wish to have a separate process for logging in users you have two options:


    1. Use a different endpoint path so that the route isn't replacing Payload's built-in login.


    2. Make a separate

    admins

    collection that is used by your admin panel and does not override the login endpoint.



    @1126575012845985924

    What do you think of those two options? I would probably do the first, seems like less work involved

  • default discord avatar
    sasuke14120last year

    I would also choose the 1st first.



    Thank you Dan.

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.