What is the best way to access all users from the auth.users table? #18780
-
Hello everyone I'm trying to access my auth.users table from the client side. I have an admin account where I want to use data like email, last login, etc. I do not want to create a new table based on auth.users. Is my best option to use a view? Also, I tried something like this:
Which is wrong based on the docs. (Also getting unauthorized error) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
The API has no access to the auth schema. You might be able to use a view. A security definer function called with rpc would work. The issue with both approaches is you will need to protect the view or rpc call so a normal user can’t call it. |
Beta Was this translation helpful? Give feedback.
The API has no access to the auth schema. You might be able to use a view. A security definer function called with rpc would work. The issue with both approaches is you will need to protect the view or rpc call so a normal user can’t call it.