Struct App.EmailPasswordClient
A class, encapsulating functionality for users, logged in with the EmailPassword provider. It is always scoped to a particular app and can only be accessed via EmailPasswordAuth.
Inherited Members
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public readonly struct App.EmailPasswordClient
Methods
| Edit this page View SourceCallResetPasswordFunctionAsync(string, string, params object?[])
Calls the reset password function, configured on the server.
Declaration
public Task CallResetPasswordFunctionAsync(string email, string password, params object?[] functionArgs)
Parameters
Type | Name | Description |
---|---|---|
string | The email of the user. |
|
string | password | The new password of the user. |
object[] | functionArgs | Any additional arguments provided to the reset function. All arguments must be serializable to JSON compatible values. |
Returns
Type | Description |
---|---|
Task | An awaitable Task representing the asynchronous request to call a password reset function. Successful completion indicates that the user's password has been change and they can now use the new password to create EmailPassword(string, string) credentials and call LogInAsync(Credentials) to login. |
ConfirmUserAsync(string, string)
Confirms a user with the given token and token id. These are typically included in the email the user received after registering.
Declaration
public Task ConfirmUserAsync(string token, string tokenId)
Parameters
Type | Name | Description |
---|---|---|
string | token | The confirmation token. |
string | tokenId | The id of the confirmation token. |
Returns
Type | Description |
---|---|
Task | An awaitable Task representing the asynchronous ConfirmUser operation. Successful completion indicates that the user has been confirmed on the server. |
Remarks
While confirmation typically happens in a web app, mobile applications that have deep linking enabled can intercept the url and complete the user confirmation flow in the app itself.
RegisterUserAsync(string, string)
Registers a new user with the given email and password.
Declaration
public Task RegisterUserAsync(string email, string password)
Parameters
Type | Name | Description |
---|---|---|
string | The email to register with. This will be the user's username and, if user confirmation is enabled, this will be the address for the confirmation email. |
|
string | password | The password to associate with the email. The password must be between 6 and 128 characters long. |
Returns
Type | Description |
---|---|
Task | An awaitable Task representing the asynchronous RegisterUser operation. Successful completion indicates that the user has been created on the server and can now be logged in calling LogInAsync(Credentials) with EmailPassword(string, string). |
ResendConfirmationEmailAsync(string)
Resends the confirmation email for a user to the given email.
Declaration
public Task ResendConfirmationEmailAsync(string email)
Parameters
Type | Name | Description |
---|---|---|
string | The email of the user. |
Returns
Type | Description |
---|---|
Task | An awaitable Task representing the asynchronous request to the server that a confirmation email is sent. Successful completion indicates that the server has accepted the request and will send a confirmation email to the specified address if a user with that email exists. |
ResetPasswordAsync(string, string, string)
Completes the reset password flow by providing the desired new password.
Declaration
public Task ResetPasswordAsync(string password, string token, string tokenId)
Parameters
Type | Name | Description |
---|---|---|
string | password | The new password for the user. |
string | token | The password reset token that was sent to the user's email address. |
string | tokenId | The password reset token id that was sent together with the |
Returns
Type | Description |
---|---|
Task | An awaitable Task representing the asynchronous request that a user's password is reset. Successful completion indicates that the user's password has been reset and they can now use the new password to create EmailPassword(string, string) credentials and call LogInAsync(Credentials) to login. |
Remarks
While the reset password flow is typically completed in the web app, mobile applications that have deep linking enabled can intercept the url and complete the password reset flow in the app itself.
RetryCustomConfirmationAsync(string)
Rerun the custom confirmation function for the given mail.
Declaration
public Task RetryCustomConfirmationAsync(string email)
Parameters
Type | Name | Description |
---|---|---|
string | The email of the user. |
Returns
Type | Description |
---|---|
Task | An awaitable Task representing the asynchronous request to the server that the custom confirmation function is run again. Successful completion indicates that the user has been confirmed on the server. |
SendResetPasswordEmailAsync(string)
Sends a password reset email to the specified address.
Declaration
public Task SendResetPasswordEmailAsync(string email)
Parameters
Type | Name | Description |
---|---|---|
string | the email of the user. |
Returns
Type | Description |
---|---|
Task | An awaitable Task representing the asynchronous request to the server that a reset password email is sent. Successful completion indicates that the server has accepted the request and will send a password reset email to the specified address if a user with that email exists. |