瀏覽代碼

auth work

reid 2 年之前
父節點
當前提交
52c91dc6d2
共有 1 個文件被更改,包括 3 次插入0 次删除
  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