pub struct AdminClient<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> AdminClient<'a>
impl<'a> AdminClient<'a>
Sourcepub async fn list_users(
&self,
page: Option<u32>,
per_page: Option<u32>,
) -> Result<AdminUserListResponse, AuthError>
pub async fn list_users( &self, page: Option<u32>, per_page: Option<u32>, ) -> Result<AdminUserListResponse, AuthError>
List all users (paginated).
Mirrors supabase.auth.admin.listUsers({ page, perPage }).
Sourcepub async fn get_user_by_id(&self, user_id: &str) -> Result<User, AuthError>
pub async fn get_user_by_id(&self, user_id: &str) -> Result<User, AuthError>
Get a user by their ID.
Mirrors supabase.auth.admin.getUserById(uid).
Sourcepub async fn create_user(
&self,
params: AdminCreateUserParams,
) -> Result<User, AuthError>
pub async fn create_user( &self, params: AdminCreateUserParams, ) -> Result<User, AuthError>
Create a new user (admin).
Does not send confirmation emails. Use invite_user_by_email for that.
Mirrors supabase.auth.admin.createUser(attributes).
Sourcepub async fn update_user_by_id(
&self,
user_id: &str,
params: AdminUpdateUserParams,
) -> Result<User, AuthError>
pub async fn update_user_by_id( &self, user_id: &str, params: AdminUpdateUserParams, ) -> Result<User, AuthError>
Update a user by their ID (admin).
Changes are applied immediately without confirmation flows.
Mirrors supabase.auth.admin.updateUserById(uid, attributes).
Sourcepub async fn delete_user(&self, user_id: &str) -> Result<(), AuthError>
pub async fn delete_user(&self, user_id: &str) -> Result<(), AuthError>
Delete a user by their ID (hard delete).
Mirrors supabase.auth.admin.deleteUser(id).
Sourcepub async fn delete_user_with_options(
&self,
user_id: &str,
soft_delete: bool,
) -> Result<(), AuthError>
pub async fn delete_user_with_options( &self, user_id: &str, soft_delete: bool, ) -> Result<(), AuthError>
Delete a user by their ID with soft-delete option.
When soft_delete is true, the user is soft-deleted (identifiable via hashed ID).
Mirrors supabase.auth.admin.deleteUser(id, shouldSoftDelete).
Sourcepub async fn invite_user_by_email(
&self,
email: &str,
redirect_to: Option<&str>,
) -> Result<User, AuthError>
pub async fn invite_user_by_email( &self, email: &str, redirect_to: Option<&str>, ) -> Result<User, AuthError>
Invite a user by email.
Sends a confirmation/invitation email to the user.
Sourcepub async fn generate_link(
&self,
params: GenerateLinkParams,
) -> Result<Value, AuthError>
pub async fn generate_link( &self, params: GenerateLinkParams, ) -> Result<Value, AuthError>
Generate a link (signup, invite, magic link, recovery, email change).
Sourcepub async fn mfa_list_factors(
&self,
user_id: &str,
) -> Result<Vec<Factor>, AuthError>
pub async fn mfa_list_factors( &self, user_id: &str, ) -> Result<Vec<Factor>, AuthError>
List MFA factors for a user (admin).
Mirrors supabase.auth.admin.mfa.listFactors().
Sourcepub async fn oauth_list_clients(
&self,
page: Option<u32>,
per_page: Option<u32>,
) -> Result<OAuthClientListResponse, AuthError>
pub async fn oauth_list_clients( &self, page: Option<u32>, per_page: Option<u32>, ) -> Result<OAuthClientListResponse, AuthError>
List all registered OAuth clients (paginated).
Mirrors supabase.auth.admin.oauth.listClients().
Sourcepub async fn oauth_create_client(
&self,
params: CreateOAuthClientParams,
) -> Result<OAuthClient, AuthError>
pub async fn oauth_create_client( &self, params: CreateOAuthClientParams, ) -> Result<OAuthClient, AuthError>
Create a new OAuth client.
Mirrors supabase.auth.admin.oauth.createClient().
Sourcepub async fn oauth_get_client(
&self,
client_id: &str,
) -> Result<OAuthClient, AuthError>
pub async fn oauth_get_client( &self, client_id: &str, ) -> Result<OAuthClient, AuthError>
Get an OAuth client by its client ID.
Mirrors supabase.auth.admin.oauth.getClient().
Sourcepub async fn oauth_update_client(
&self,
client_id: &str,
params: UpdateOAuthClientParams,
) -> Result<OAuthClient, AuthError>
pub async fn oauth_update_client( &self, client_id: &str, params: UpdateOAuthClientParams, ) -> Result<OAuthClient, AuthError>
Update an OAuth client.
Mirrors supabase.auth.admin.oauth.updateClient().
Sourcepub async fn oauth_delete_client(
&self,
client_id: &str,
) -> Result<(), AuthError>
pub async fn oauth_delete_client( &self, client_id: &str, ) -> Result<(), AuthError>
Delete an OAuth client.
Mirrors supabase.auth.admin.oauth.deleteClient().
Sourcepub async fn oauth_regenerate_client_secret(
&self,
client_id: &str,
) -> Result<OAuthClient, AuthError>
pub async fn oauth_regenerate_client_secret( &self, client_id: &str, ) -> Result<OAuthClient, AuthError>
Regenerate the client secret for an OAuth client.
Mirrors supabase.auth.admin.oauth.regenerateClientSecret().