What's not working?
Currently for auth impersonation in studio, we use this function: https://github.com/redwoodjs/redwood/blob/main/packages/auth-providers/dbAuth/api/src/shared.ts#L45 to "override" the auth sent by requests from studio.
The problem with this approach is that with Web API Requests - the body has to be parsed async. i.e.
const body = await request.text()
This requires the function to be async - and needs a lot of changes in the dbAuthHandler to make it work.
I'm not sure how the impersonated Cookie gets set in studio but...
Suggestion: use a different header like X-RWS-AuthImpersonation so that the eventGraphiQLHeadersCookie can continue to be sync (just like req.headers.get('Authorization')
How do we reproduce the bug?
N/A
What's your environment? (If it applies)
No response
Are you interested in working on this?
What's not working?
Currently for auth impersonation in studio, we use this function: https://github.com/redwoodjs/redwood/blob/main/packages/auth-providers/dbAuth/api/src/shared.ts#L45 to "override" the auth sent by requests from studio.
The problem with this approach is that with Web API Requests - the body has to be parsed async. i.e.
This requires the function to be async - and needs a lot of changes in the
dbAuthHandlerto make it work.I'm not sure how the impersonated Cookie gets set in studio but...
Suggestion: use a different header like
X-RWS-AuthImpersonationso that theeventGraphiQLHeadersCookiecan continue to be sync (just likereq.headers.get('Authorization')How do we reproduce the bug?
N/A
What's your environment? (If it applies)
No response
Are you interested in working on this?