FeatureFuel
3

Surface user impersonation in SDKs

Source: supabase/supabase#36310 · opened by @bdotsamir
Hello!

It's already very useful be able to impersonate various users in the dashboard, but it would be even more amazing if Supabase could expose the impersonation capability in the SDKs offered (in @supabase/supabase-js, it would have to be under the supabase.auth.admin namespace definitely).

My use case for this: I use a custom auth hook which modifies the JWT. My RLS policies then rely on this modified JWT to have a certain property, and allow/deny access accordingly. As you might be able to imagine, simply impersonating a user via the Supabase dashboard in most cases is not enough to thoroughly test my policies, as the user impersonation does not "log in" as that user, and thus does not run the auth hook.

It would be incredible if the SDKs could expose user impersonation to us users so that we can then implement our own versions of impersonation. Maybe something like const { user, error } = await supabase.auth.admin.impersonate(userID)

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests