Surface user impersonation in SDKs #36310
Unanswered
bdotsamir
asked this question in
Feature Requests
Replies: 1 comment
|
You can do this currently with https://supabase.com/docs/reference/javascript/auth-admin-generatelink . |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.adminnamespace 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)All reactions