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.

How to hide APIKey in Rest Response with useAPIKey enabled?

default discord avatar
xhomu2 years ago
3

With useAPIKey enabled in an user collection, the apiKey and enableAPIKey fields are always returned from the REST API.



Is there any way to config to hide the these fields by default?



Found an outstanding issue on this on roadmap

https://github.com/payloadcms/payload/discussions/4400
  • default discord avatar
    oldmanpewpew2 years ago

    You can use the afterRead hook on the collection to strip it out. It is “interesting” this work around is needed haha

  • default discord avatar
    xhomu2 years ago

    Thanks, I'll do that for now!

  • default discord avatar
    simka09972 years ago

    I agree

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.