From ba0497cb23f9a484fcf17c7e0aab018c37181a22 Mon Sep 17 00:00:00 2001 From: gjsmith66 Date: Thu, 17 Dec 2015 13:36:51 -0500 Subject: [PATCH] Update README.md Update README.md to fix example on how to handle unauthorized access. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be41081..a05ec61 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,8 @@ Your client-side code should handle it as below. __Client side__: ```javascript -socket.on("error", function(error) { - if (error.type == "UnauthorizedError" || error.code == "invalid_token") { +socket.on("unauthorized", function(error) { + if (error.data.type == "UnauthorizedError" || error.data.code == "invalid_token") { // redirect user to login page perhaps? console.log("User's token has expired"); }