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.

Populate data on first login

default discord avatar
maxswjeonlast year
3

Can I populate data to a collection on first login? I do not want to run collection item checks on all Collection#beforeRead hook.

  • default discord avatar
    notchrlast year
    @390564217729581056

    How about on the "create" operation, then check the document count in Users



    If you hook into that, I think you'll get the event for the initial user creation

  • default discord avatar
    maxswjeonlast year

    More context, I am creating a User and Provider Set, where Provider contains data for OAuth2 Providers with Payload 3.0



    Local Provider should be automatically created for first user, so I want to check it.



    Oh... I know what you mean. Thanks!

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.