mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-27 14:54:55 +00:00
Logging in using an admin token should be synchronous (#2040)
* Logging in using an admin token should be synchronous
This commit is contained in:
parent
6e15b2ed8e
commit
be98a77fcf
@ -4,12 +4,11 @@ x.x.x Release notes (yyyy-MM-dd)
|
||||
* None
|
||||
|
||||
### Fixes
|
||||
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
|
||||
* None
|
||||
* Fixed a bug where logging in using an admin token returned a promise. The correct behavior is to be synchronous. (related to [#2037](https://github.com/realm/realm-js/issues/2037), since v2.16.1)
|
||||
|
||||
### Compatibility
|
||||
* File format: ver. 7 (upgrades automatically from previous formats)
|
||||
* Realm Object Server: 3.11.0 or later.
|
||||
* Realm Object Server: 3.0.0 or later.
|
||||
* APIs are backwards compatible with all previous release of realm in the 2.x.y series.
|
||||
|
||||
### Internal
|
||||
@ -25,7 +24,7 @@ x.x.x Release notes (yyyy-MM-dd)
|
||||
|
||||
### Compatibility
|
||||
* File format: ver. 7 (upgrades automatically from previous formats)
|
||||
* Realm Object Server: 3.11.0 or later.
|
||||
* Realm Object Server: 3.0.0 or later.
|
||||
* APIs are backwards compatible with all previous release of realm in the 2.x.y series.
|
||||
|
||||
### Internal
|
||||
|
@ -382,7 +382,7 @@ const staticMethods = {
|
||||
checkTypes(arguments, ['string', 'object']);
|
||||
if (credentials.identityProvider === 'adminToken') {
|
||||
let u = this._adminUser(server, credentials.token);
|
||||
return Promise.resolve(u);
|
||||
return u;
|
||||
}
|
||||
|
||||
return _authenticate(this, server, credentials);
|
||||
|
@ -206,12 +206,8 @@ module.exports = {
|
||||
let token = obj['ADMIN_TOKEN'];
|
||||
|
||||
let credentials = Realm.Sync.Credentials.adminToken(token);
|
||||
return Realm.Sync.User.login('http://localhost:9080', credentials)
|
||||
.then((user) => {
|
||||
let user = Realm.Sync.User.login('http://localhost:9080', credentials);
|
||||
TestCase.assertTrue(user.isAdmin);
|
||||
Promise.resolve();
|
||||
})
|
||||
.catch((e) => { Promise.reject(e) } );
|
||||
},
|
||||
|
||||
testAll() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user