reid 2 lat temu
rodzic
commit
52c91dc6d2
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      auth/auth.go

+ 3 - 0
auth/auth.go

@@ -102,6 +102,9 @@ func AddToAuthMap(conn *websocket.Conn, token map[string]string, authed bool) er
 // check the validity of the token
 func CheckToken(token map[string]string, conn *websocket.Conn, r *http.Request, setup bool) bool {
 	// great you have token. we see if valid.
+	if token["token"] == "" {
+		return false
+	}
 	config.Logger.Info(fmt.Sprintf("Checking token %s",token["id"]))
 	conf := config.Conf()
 	key := conf.KeyFile