Possible to Access Payload Instance Inside BeforeLogin?

default discord avatar
Bradleykingz
3 months ago
1 1

As per the title, I want to access payload inside beforeLogin in order to make some queries to the DB. Currently, I get an error - Uncaught (in promise) TypeError: payload__WEBPACK_IMPORTED_MODULE_1__.default.find is not a function.

Is it simply not possible? Or is there a way to work around it?

  • default discord avatar
    Bradleykingz
    3 months ago

    To answer my own question, it's probably a better idea to make a direct request to the API.

Open the post
Continue the discussion in GitHub
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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