Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support EmailPassword confirm user #478

Merged
merged 95 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
453e018
Rollback Dart_WeakHandle finalizer hack
nielsenko Mar 14, 2022
8430d42
Use dart main/flutter beta in github actions.
nielsenko Mar 22, 2022
e847de2
Add dart specific support for realm_http_transport_new
nielsenko Mar 16, 2022
6a5c9c4
Wire up realm_core
nielsenko Mar 18, 2022
fca9182
Apply suggestions from code review
nielsenko Mar 28, 2022
435e484
Copy all info from realm_http_request before starting async request
nielsenko Mar 28, 2022
d7207d9
Added ApplicationConfiguration
nielsenko Mar 18, 2022
ea8d7ef
Added Application class with async logIn method (includes stubs for U…
nielsenko Mar 25, 2022
b4eaf29
Implement email/password provider
desistefanova Mar 30, 2022
5e887a0
Implement RegisterUser in Application emailPasswordProvider
desistefanova Mar 31, 2022
b034700
test commented
desistefanova Mar 31, 2022
44625d4
CHANGELOG.md
desistefanova Mar 31, 2022
a54b1a8
Use common GCHandle class for userdata on all callbacks
nielsenko Mar 30, 2022
6ae70e2
Support hard gc handles as well, as suggested by Yavor. Ie. handles t…
nielsenko Apr 7, 2022
c81e0c0
Backport to dart 2.16 where we have to work around a finalization iss…
nielsenko Apr 1, 2022
6899dc8
Add support for http_transport
nielsenko Mar 18, 2022
9a17d45
Added ApplicationConfiguration
nielsenko Mar 18, 2022
73e2e4c
Update docs on public interface
nielsenko Apr 7, 2022
0baa62f
Address PR feedback
nielsenko Apr 11, 2022
20e95af
Added Application class with async logIn method (includes stubs for U…
nielsenko Apr 8, 2022
d63f205
Add testWithBass function
nielsenko Apr 8, 2022
0cdf4b7
Merge branch 'master' into realm_app_config
desistefanova Apr 11, 2022
b9cc163
Update CHANGELOG.md
desistefanova Apr 11, 2022
8448ffd
Merge branch 'realm_app_config' into realm_app
desistefanova Apr 11, 2022
7ff02ef
Commit after merge
desistefanova Apr 11, 2022
fc5e481
Fixes after merge
desistefanova Apr 11, 2022
c1cb35e
Merge branch 'realm_app'
desistefanova Apr 12, 2022
e07be97
Fixes after merge
desistefanova Apr 12, 2022
b7ddc96
Remove user and login
desistefanova Apr 12, 2022
938a168
size of handles
desistefanova Apr 12, 2022
d447fe0
Set size of handles
desistefanova Apr 12, 2022
ef644c5
workflow chanel = stable
desistefanova Apr 12, 2022
a132bf4
Delete realm_dart_http_transport
desistefanova Apr 12, 2022
4e15ea7
remove import dart:async from tests
desistefanova Apr 12, 2022
c453fde
Merge branch 'master' into realm_app
desistefanova Apr 12, 2022
348ed3e
Fixes after merge
desistefanova Apr 12, 2022
2778ff2
Fix after merge
desistefanova Apr 12, 2022
b26fc19
Merge branch 'realm_app' into auth_provider_register_email
desistefanova Apr 12, 2022
de08be0
Fix after merge
desistefanova Apr 12, 2022
a359038
Merge branch 'master' into realm_app
desistefanova Apr 12, 2022
792589b
Merge branch 'realm_app' into login_user
desistefanova Apr 12, 2022
6f28a22
Fix after merge
desistefanova Apr 12, 2022
1489eee
Merge branch 'master' into realm_app
desistefanova Apr 12, 2022
9fd8fec
Fix after merge
desistefanova Apr 12, 2022
07be0ae
Fix after merge
desistefanova Apr 12, 2022
b85cbb4
Merge branch 'realm_app' into login_user
desistefanova Apr 12, 2022
18ec3ca
Updarte CHANGELOG.md
desistefanova Apr 12, 2022
a69d013
Merge branch 'master' into login_user
blagoev Apr 13, 2022
60b665c
fix build
blagoev Apr 13, 2022
4e26d96
rename method
blagoev Apr 13, 2022
b94d62c
fix login invocation
blagoev Apr 13, 2022
bad719b
fix GC hints
blagoev Apr 13, 2022
333b99d
[test] build in debug
blagoev Apr 13, 2022
16d60f2
Merge branch 'master' into auth_provider_register_email
desistefanova Apr 13, 2022
3083650
Fix after merge
desistefanova Apr 13, 2022
2603ef6
Callback implementation changes
desistefanova Apr 13, 2022
2490fe4
Remove tests
desistefanova Apr 13, 2022
9e990c2
Delete old file
desistefanova Apr 14, 2022
17be615
Delete old files
desistefanova Apr 14, 2022
e8aa395
application holds the HttpTransport, AppConfig and SyncClient handles
blagoev Apr 17, 2022
5f3ace8
Merge branch 'master' into login_user
blagoev Apr 17, 2022
6d3e1bf
Merge branch 'master' into auth_provider_register_email
blagoev Apr 19, 2022
3c74ed6
move and rename EmailPassword class
blagoev Apr 19, 2022
47f48a9
EmailPasswordAuthProvider as standalone class
blagoev Apr 19, 2022
fedba5a
support EmailPassword confirm user
blagoev Apr 19, 2022
9f2fb6d
update changelog
blagoev Apr 19, 2022
9fc1e1b
support weak and persistent handles
blagoev Apr 20, 2022
0ed9ada
add api doc
blagoev Apr 20, 2022
a94f222
add user api doc
blagoev Apr 20, 2022
ab1f03e
revert build type for linux
blagoev Apr 20, 2022
bcbc522
add ctor api doc
blagoev Apr 20, 2022
d8effa6
remove dead arg
blagoev Apr 20, 2022
188cf97
expose correct class,
blagoev Apr 20, 2022
4b0afec
fix build
blagoev Apr 20, 2022
588fe1d
Merge branch 'login_user' into auth_provider_register_email
blagoev Apr 20, 2022
c8848bf
use persistent handle for register user call
blagoev Apr 20, 2022
577b79f
await inside realm_core login
blagoev Apr 21, 2022
59ef6cd
revert to non async method
blagoev Apr 21, 2022
e3e6278
Merge branch 'auth_provider_register_email' into emailpassword-confir…
blagoev Apr 21, 2022
3438f38
use persistent handle
blagoev Apr 21, 2022
5a1523e
use named arg
blagoev Apr 21, 2022
ef5e89d
rename methods
blagoev Apr 21, 2022
8c0deb4
use string skip if url not present in test env
blagoev Apr 21, 2022
b37247d
move creation of httpTransportHandle, appConfigHandle and sycnClientC…
blagoev Apr 21, 2022
9c7127d
rename TO BAAS
blagoev Apr 21, 2022
7cc27d0
rename to BAAS
blagoev Apr 21, 2022
ec217bb
use non async login method
blagoev Apr 21, 2022
6392968
set skip to error if url is null
blagoev Apr 21, 2022
912e7f2
Merge branch 'login_user' into auth_provider_register_email
blagoev Apr 21, 2022
7bc1377
Merge branch 'auth_provider_register_email' into emailpassword-confir…
blagoev Apr 21, 2022
2507a00
fix
blagoev Apr 21, 2022
5d1ce11
Merge branch 'auth_provider_register_email' into emailpassword-confir…
blagoev Apr 21, 2022
622ad31
remove dead file
blagoev Apr 21, 2022
892d9c1
remove dead code
blagoev Apr 21, 2022
93f6cd1
Merge branch 'master' into emailpassword-confirm-user
blagoev Apr 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ x.x.x Release notes (yyyy-MM-dd)
* Support ObjectId type. ([#468](https://github.com/realm/realm-dart/pull/468))
* Support Uuid type. ([#470](https://github.com/realm/realm-dart/pull/470))
* Support application login. ([#469](https://github.com/realm/realm-dart/pull/469))
* Support user registration with EmailPassword authentication provider. ([#452](https://github.com/realm/realm-dart/pull/452))
* Support EmailPassword register user. ([#452](https://github.com/realm/realm-dart/pull/452))
* Support EmailPassowrd confirm user. ([#478](https://github.com/realm/realm-dart/pull/478))

### Fixed
* Fixed an issue that would result in the wrong transaction being rolled back if you start a write transaction inside a write transaction. ([#442](https://github.com/realm/realm-dart/issues/442))
Expand Down
9 changes: 7 additions & 2 deletions lib/src/credentials.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ class EmailPasswordAuthProvider {
/// The [password] to associate with the email. The password must be between 6 and 128 characters long.
///
/// Successful completion indicates that the user has been created on the server and can now be logged in with [Credentials.emailPassword()].
Future<void> registerUser(String email, String password) async {
return realmCore.appEmailPasswordRegisterUser(application, email, password);
Future<void> registerUser(String email, String password) {
return realmCore.emailPasswordRegisterUser(application, email, password);
}

/// Confirms a user with the given token and token id. These are typically included in the registration email.
Future<void> confirmUser(String token, String tokenId) {
return realmCore.emailPasswordConfirmUser(application, token, tokenId);
}
}
17 changes: 16 additions & 1 deletion lib/src/native/realm_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ class _RealmCore {
completer.complete();
}

Future<void> appEmailPasswordRegisterUser(Application application, String email, String password) {
Future<void> emailPasswordRegisterUser(Application application, String email, String password) {
final completer = Completer<void>();
using((arena) {
_realmLib.invokeGetBool(() => _realmLib.realm_app_email_password_provider_client_register_email(
Expand All @@ -920,6 +920,21 @@ class _RealmCore {
});
return completer.future;
}

Future<void> emailPasswordConfirmUser(Application application, String token, String tokenId) {
final completer = Completer<void>();
using((arena) {
_realmLib.invokeGetBool(() => _realmLib.realm_app_email_password_provider_client_confirm_user(
application.handle._pointer,
token.toUtf8Ptr(arena),
tokenId.toUtf8Ptr(arena),
Pointer.fromFunction(void_completion_callback),
completer.toPersistentHandle(),
_deletePersistentHandleFuncPtr,
));
});
return completer.future;
}
}

class LastError {
Expand Down