Skip to content

Change auth impersonation in Studio to not use Request body #9801

@dac09

Description

@dac09

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?

  • I'm interested in working on this

Metadata

Metadata

Labels

bug/confirmedWe have confirmed this is a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions