Skip to content

Commit

Permalink
(DOCSP-34287) Add documentation for `App.EmailPassword.retryCustomCon…
Browse files Browse the repository at this point in the history
…firmation` (#3098)

## Pull Request Info

Jira ticket: https://jira.mongodb.org/browse/DOCSP-34287
Staged changes:

- [Manage Email/Password
Users](https://preview-mongodbkrollinsmdb.gatsbyjs.io/realm/DOCSP-34457/sdk/dotnet/manage-users/manage-email-password-users/#retry-a-user-confirmation-function)

Add an example for the new App.EmailPassword.retryCustomConfirmation
method.

### Reminder Checklist

Before merging your PR, make sure to check a few things.

- [x] Describe your PR's changes in the Release Notes section
- [x] Create a Jira ticket for corresponding docs-app-services work if
needed

### Release Notes

- **.NET SDK**
- Manage Users/Manage Email/Password Users: Add an example for the new
App.EmailPassword.retryCustomConfirmation method and the older,
undocumented, App.EmailPassword.ResendConfirmationEmailAsync method.

### Review Guidelines


[REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)

---------

Co-authored-by: cbullinger <115956901+cbullinger@users.noreply.github.com>
  • Loading branch information
krollins-mdb and cbullinger authored Dec 4, 2023
1 parent 042978a commit 6e66c33
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/dotnet/Examples/Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="Realm" Version="11.5.0" />
<PackageReference Include="Realm" Version="11.6.1" />
<PackageReference Include="Realm.Fody" Version="11.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
10 changes: 9 additions & 1 deletion examples/dotnet/Examples/WorkWithRealm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async System.Threading.Tasks.Task Setup()

public async System.Threading.Tasks.Task LotsaStuff()
{
string userEmail = "bob@bob.com";
string userEmail = "bob@example.com";

// :snippet-start: initialize-realm
var myRealmAppId = "<your_app_id>";
Expand Down Expand Up @@ -73,6 +73,12 @@ await app.EmailPasswordAuth.CallResetPasswordFunctionAsync(
await app.EmailPasswordAuth.CallResetPasswordFunctionAsync(
userEmail, myNewPassword);
//:snippet-end:
// :snippet-start: resend-confirmation
await app.EmailPasswordAuth.ResendConfirmationEmailAsync("<userEmail>");
// :snippet-end:
// :snippet-start: retry-custom-confirmation
await app.EmailPasswordAuth.RetryCustomConfirmationAsync("<userEmail>");
// :snippet-end:

user = await app.LogInAsync(Config.EPCreds);

Expand Down Expand Up @@ -239,6 +245,8 @@ public void Notifications()
[Test]
public void ChangeSetCleared()
{
var config = new RealmConfiguration("");

myRealmAppId = Config.AppId;
var app = App.Create(myRealmAppId);
var realm = Realm.GetInstance("");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
await app.EmailPasswordAuth.ResendConfirmationEmailAsync("<userEmail>");
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
await app.EmailPasswordAuth.RetryCustomConfirmationAsync("<userEmail>");
24 changes: 24 additions & 0 deletions source/sdk/dotnet/manage-users/manage-email-password-users.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,30 @@ mehtod.
.. literalinclude:: /examples/generated/dotnet/WorkWithRealm.snippet.confirm-user.cs
:language: csharp

Resend a Confirmation Email
---------------------------

To resend a confirmation email, call the
:dotnet-sdk:`ResendConfirmationEmailAsync()
<reference/Realms.Sync.App.EmailPasswordClient.html#Realms_Sync_App_EmailPasswordClient_ResendConfirmationEmailAsync_System_String_>`
method with the user's email address.

.. literalinclude:: /examples/generated/dotnet/WorkWithRealm.snippet.resend-confirmation.cs
:language: csharp

Retry a User Confirmation Function
----------------------------------

To resend a confirmation email using a custom function, call the
:dotnet-sdk:`RetryCustomConfirmationAsync()
<reference/Realms.Sync.App.EmailPasswordClient.html#Realms_Sync_App_EmailPasswordClient_RetryCustomConfirmationAsync_System_String_>`
method with the user's email address.

.. literalinclude:: /examples/generated/dotnet/WorkWithRealm.snippet.retry-custom-confirmation.cs
:language: csharp

For more information, refer to :ref:`<auth-run-a-confirmation-function>` in the App Services documentation.

.. _dotnet-email-password-reset-password:

Reset a User's Password
Expand Down

0 comments on commit 6e66c33

Please sign in to comment.