Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Custom confirmation logic support #1080

Merged
merged 5 commits into from
Sep 14, 2020
Merged

Conversation

clementetb
Copy link
Contributor

Add support for calling the custom confirmation function from the SDKs

@@ -228,6 +228,29 @@ void App::UsernamePasswordProviderClient::resend_confirmation_email(const std::s
}, handler);
}

void App::UsernamePasswordProviderClient::retry_custom_confirmation(const std::string& email,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct function name? Maybe I'm misunderstanding, but it seems like call_custom_confirmation_function might be a bit clearer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we need to agree on how to expose this to users 😅 realm/realm-java#7079 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By popular vote, we agreed on retry_custom_confirmation

src/sync/app.hpp Outdated
/// Calls the custom confirmation function on a user for a given email.
/// @param email The email address of the user to call the custom confirmation for.
/// @param completion_block A callback to be invoked once the call is complete.
void call_custom_confirmation_function(const std::string& email,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to test this in ObjectStore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a custom confirmation function to the config of the docker test server in the same way that we test email registration by only allowing emails that contain "realm_tests_do_autoverify" (see here and here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added test cases for the custom confirmation function, following the same pattern as call_reset_password_function.

@cmelchior cmelchior merged commit 08f10f4 into v10 Sep 14, 2020
@cmelchior cmelchior deleted the ct/custom-confirmation-logic branch September 14, 2020 12:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants