mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-10 22:36:01 +00:00
throw exception when trying to open a realm with an invalid user
This commit is contained in:
parent
08ffc3bf15
commit
d229cd6130
@ -264,6 +264,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CXX = "$(SRCROOT)/../../scripts/ccache-clang++.sh";
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
@ -314,6 +315,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CXX = "$(SRCROOT)/../../scripts/ccache-clang++.sh";
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
@ -1012,6 +1012,7 @@
|
|||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
CURRENT_PROJECT_VERSION = 0.14.3;
|
CURRENT_PROJECT_VERSION = 0.14.3;
|
||||||
|
CXX = "$(SRCROOT)/../scripts/ccache-clang++.sh";
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
@ -1074,6 +1075,7 @@
|
|||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
CURRENT_PROJECT_VERSION = 0.14.3;
|
CURRENT_PROJECT_VERSION = 0.14.3;
|
||||||
|
CXX = "$(SRCROOT)/../scripts/ccache-clang++.sh";
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
@ -295,6 +295,10 @@ void SyncClass<T>::populate_sync_config(ContextType ctx, FunctionType realm_cons
|
|||||||
|
|
||||||
ObjectType user = Object::validated_get_object(ctx, sync_config_object, "user");
|
ObjectType user = Object::validated_get_object(ctx, sync_config_object, "user");
|
||||||
SharedUser shared_user = *get_internal<T, UserClass<T>>(user);
|
SharedUser shared_user = *get_internal<T, UserClass<T>>(user);
|
||||||
|
if (shared_user->state() != SyncUser::State::Active) {
|
||||||
|
throw std::runtime_error("User is no longer valid.");
|
||||||
|
}
|
||||||
|
|
||||||
std::string raw_realm_url = Object::validated_get_string(ctx, sync_config_object, "url");
|
std::string raw_realm_url = Object::validated_get_string(ctx, sync_config_object, "url");
|
||||||
|
|
||||||
// FIXME - use make_shared
|
// FIXME - use make_shared
|
||||||
|
@ -109,8 +109,9 @@ module.exports = {
|
|||||||
TestCase.assertUndefined(Realm.Sync.User.current);
|
TestCase.assertUndefined(Realm.Sync.User.current);
|
||||||
|
|
||||||
// Can we open a realm with the registered user?
|
// Can we open a realm with the registered user?
|
||||||
var realm = new Realm({sync: {user: user, url: 'realm://localhost:9080/~/test'}});
|
TestCase.assertThrows(function() {
|
||||||
TestCase.assertUndefined(realm);
|
var realm = new Realm({sync: {user: user, url: 'realm://localhost:9080/~/test'}});
|
||||||
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -825,6 +825,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CXX = "$(SRCROOT)/../../../scripts/ccache-clang++.sh";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
@ -878,6 +879,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
|
CXX = "$(SRCROOT)/../../../scripts/ccache-clang++.sh";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user