Update README.md
Update README.md to fix example on how to handle unauthorized access.
This commit is contained in:
parent
c31764aac3
commit
ba0497cb23
@ -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");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user