2
1
mirror of https://github.com/Thream/socketio-jwt.git synced 2024-07-21 09:38:31 +02:00

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");
} }