Skip to content

Commit 1b742f6

Browse files
authored
Merge pull request #2 from bflorian/changed-serialization
Removed explicit JSON serialization and unnecessary client ID and secret
2 parents cabfba1 + c4db602 commit 1b742f6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ module.exports = class DynamoDBContextStore {
2424
} else {
2525
if (data.Item) {
2626
let result = data.Item;
27-
result.config = JSON.parse(result.config);
27+
28+
// For backward compatibility with version 1.0.1
29+
if (typeof result.config === 'string') {
30+
result.config = JSON.parse(result.config);
31+
}
2832
resolve(result);
2933
}
3034
else {
@@ -43,9 +47,7 @@ module.exports = class DynamoDBContextStore {
4347
locationId: params.locationId,
4448
authToken: params.authToken,
4549
refreshToken: params.refreshToken,
46-
clientId: params.clientId,
47-
clientSecret: params.clientSecret,
48-
config: JSON.stringify(params.config)
50+
config: params.config
4951
}
5052
};
5153
return new Promise((resolve, reject) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smartthings/dynamodb-context-store",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Stores SmartApp configuration and auth tokens for use in app-initiated calls",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)