ca98am79 / connect-dynamodb

DynamoDB session store for Connect
http://ca98am79.github.com/connect-dynamodb/
MIT License
144 stars 66 forks source link

Fix #44 - don't crash on invalid session data stored in DDB #61

Closed mherger closed 4 years ago

mherger commented 4 years ago

There seem to be cases where a session would be stored without the actual payload:

{"expires":{"N":"1503608283"},"id":{"S":"sess:awkd99aLsGDn3Kmrv7JFSaMzPTL3rzfH"}}

store.get() would throw an error, as it doesn't test the existence of a sess element. Change the code to test its existence before reading it. Return as if the session had expired in case of non-existence.

Fix another crasher where destroyDataAt() would try to access this.hashKey after a context switch. Use self.hashKey instead.

ca98am79 commented 4 years ago

thanks!