mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-23 21:10:01 +00:00
Depreciate setAccessToken
rename setAccessToken to setFeatureToken expose both functions while setAccessToken is depreciated Trim token argument string
This commit is contained in:
parent
08acb83e58
commit
86999412f0
@ -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 depreciated setAccessToken
|
||||
realmConstructor.Sync.setAccessToken = realmConstructor.Sync.setFeatureToken;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove this now useless object.
|
||||
|
Loading…
x
Reference in New Issue
Block a user