Is it possible to create a register page rather than creating users yourself?

default discord avatar
Deleted Userlast year
12

I think I can handle the backend logic but I was hoping for a native way to do this, especially design-wise, I don't want this custom page to stick out.

  • default discord avatar
    thisisnotchrislast year

    You can create a page on your front-end that can register users with Payload. You would have a form with the required User fields and you would submit a post request to the User collection /create endpoint. You will also need to handle -> Displaying errors (Invalid email, password, etc) and displaying success messages to the end user. You will also want to look at the docs for "Forgot Password" and other user-related endpoints.



    We do this for our company website, it takes a little setup, but works nicely.



    There are examples of using payload to create a registration system in the payload repository home on github.



    The benefits of using a system like Payload for authentication outweigh building your own IMO



    (from scratch)

  • default discord avatar
    Deleted Userlast year

    Thanks for the reply. I don't have a separate frontend app, I was hoping to extend Payload CMS to serve a page using a custom route. Is that not possible? Also I couldn't find a register system example in the official repository.

  • default discord avatar
    generator101last year

    for the access in your user collections just add anyone can register



    https://github.com/payloadcms/next-auth-cms/blob/main/src/collections/Users/index.ts#L33


    see this



    there will be a register button then where people can register

  • default discord avatar
    Deleted Userlast year

    good idea, thanks a lot!

  • default discord avatar
    avant_12 months ago

    For those like me, it's not /create anymore, it's



    POST /api/{collection-slug} Create a new document



    https://payloadcms.com/docs/rest-api/overview
Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.