reid преди 2 години
родител
ревизия
75880b32c3
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      auth/auth.go

+ 2 - 0
auth/auth.go

@@ -100,6 +100,7 @@ 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.
+	config.Logger.Info(fmt.Sprintf("Checking token %s",token["id"]))
 	conf := config.Conf()
 	key := conf.KeyFile
 	res, err := KeyfileDecrypt(token["token"], key)
@@ -120,6 +121,7 @@ func CheckToken(token map[string]string, conn *websocket.Conn, r *http.Request,
 		// you in auth map?
 		if WsIsAuthenticated(conn, hash) {
 			if ip == res["ip"] && userAgent == res["user_agent"] {
+				config.Logger.Info("Token authenticated")
 				return true
 			} else {
 				config.Logger.Warn("Token doesn't match session!")