Report error to websocket client if they do an unauthorised request

This commit is contained in:
Adrian Gallagher
2018-06-07 15:23:53 +10:00
parent 58051b89c7
commit d34fc9aae8

View File

@@ -176,6 +176,7 @@ func (c *WebsocketClient) read() {
if result.authRequired && !c.Authenticated {
log.Printf("Websocket: request %s failed due to unauthenticated request on an authenticated API", evt.Event)
c.SendWebsocketMessage(WebsocketEventResponse{Event: evt.Event, Error: "unauthorised request on authenticated API"})
continue
}