Export "AuthContext" and "useAuth" in "payload/auth"

default discord avatar
finkinfridom
11 months ago
1 1

I am playing around with the admin.avatar configuration and it was very difficult to spot the proper location for useAuth (similarly to what happens here: https://github.com/payloadcms/payload/blob/master/src/admin/components/graphics/Account/Gravatar.tsx).

I was able to import useAuth from payload/dist/admin/components/utilities/Auth but it's pretty nested.

Would it be possible to move the useAuth into payload/auth?

Thanks

  • discord user avatar
    jacobsfletch
    Payload Team
    8 months ago

    @finkinfridom absolutely! It's in our roadmap to significantly improve our component library, including how components are exported as you mentioned, and also documentation. Here's a related discussion: #1729

    If you need this right away we'd be happy to accept a PR!

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.