Is there a way to retrieve user headers in an afterCreate hook?
Say, for instance, you create some resources following an organization creation via the afterCreateOrg hook.
If it throws an error and I want to undo the org creation, I can use the auth.api.deleteOrganization method but it requires user headers.
I thought to use a createAuthMiddleware hook but couldn't figure out how to pass headers into the afterCreate hook itself.
Any guidance?
Should I just write some method to remove the org via normal DB calls and skip better-auth altogether?
If it throws an error and I want to undo the org creation, I can use the auth.api.deleteOrganization method but it requires user headers.
I thought to use a createAuthMiddleware hook but couldn't figure out how to pass headers into the afterCreate hook itself.
Any guidance?
Should I just write some method to remove the org via normal DB calls and skip better-auth altogether?