Update README.md

Update README.md to fix example on how to handle unauthorized access.
This commit is contained in:
gjsmith66 2015-12-17 13:36:51 -05:00
parent c31764aac3
commit ba0497cb23

View File

@ -95,8 +95,8 @@ Your client-side code should handle it as below.
__Client side__: __Client side__:
```javascript ```javascript
socket.on("error", function(error) { socket.on("unauthorized", function(error) {
if (error.type == "UnauthorizedError" || error.code == "invalid_token") { if (error.data.type == "UnauthorizedError" || error.data.code == "invalid_token") {
// redirect user to login page perhaps? // redirect user to login page perhaps?
console.log("User's token has expired"); console.log("User's token has expired");
} }