Merge pull request #1210 from realm/depreciate-setAccessToken
Deprecate setAccessToken
This commit is contained in:
commit
cd187eca43
|
@ -104,6 +104,19 @@ module.exports = function(realmConstructor) {
|
|||
|
||||
setConstructorOnPrototype(realmConstructor.Sync.User);
|
||||
setConstructorOnPrototype(realmConstructor.Sync.Session);
|
||||
|
||||
if (realmConstructor.Sync._setFeatureToken) {
|
||||
realmConstructor.Sync.setFeatureToken = function(featureToken) {
|
||||
if (typeof featureToken !== 'string' || !featureToken instanceof String) {
|
||||
throw new Error("featureToken should be a string");
|
||||
}
|
||||
|
||||
realmConstructor.Sync._setFeatureToken(featureToken.trim());
|
||||
}
|
||||
|
||||
//enable deprecated setAccessToken
|
||||
realmConstructor.Sync.setAccessToken = realmConstructor.Sync.setFeatureToken;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove this now useless object.
|
||||
|
|
Loading…
Reference in New Issue