From d1c4ba496d91c9f66c3eee8551bcf1476b422616 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 25 Apr 2024 13:56:29 +0200 Subject: [PATCH] feat(backend): changed licence verification url --- ee/backend/pkg/license/check.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/ee/backend/pkg/license/check.go b/ee/backend/pkg/license/check.go index 771558946..cd92ab736 100644 --- a/ee/backend/pkg/license/check.go +++ b/ee/backend/pkg/license/check.go @@ -1,39 +1,36 @@ package license import ( - "log" - "net/http" + "bytes" "encoding/json" "io/ioutil" - "bytes" + "log" + "net/http" "openreplay/backend/pkg/env" ) - - type request struct { - MID string `json:"mid"` + MID string `json:"mid"` License string `json:"license"` } type response struct { Data struct { - IsValid bool `json:"valid"` + IsValid bool `json:"valid"` ExpirationTimestamp int64 `json:"expiration"` } `json:"data"` } - func CheckLicense() { license := env.String("LICENSE_KEY") - requestBody, err := json.Marshal(request{ License: license }) + requestBody, err := json.Marshal(request{License: license}) if err != nil { log.Fatal("Can not form a license check request.") } - resp, err := http.Post("https://api.openreplay.com/os/license", "application/json", bytes.NewReader(requestBody)) + resp, err := http.Post("https://api.openreplay.com/os/license/validate", "application/json", bytes.NewReader(requestBody)) if err != nil { log.Fatalf("Error while checking license. %v", err) } @@ -57,5 +54,4 @@ func CheckLicense() { log.Fatal("License is not valid.") } - -} \ No newline at end of file +}