From 1cfacd21636239614d39621103899032129d950d Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Tue, 30 Apr 2024 21:05:07 +0100 Subject: [PATCH 1/2] fix: change user create api key path --- src/utils/api/ApiKeyRedirectUrlBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/api/ApiKeyRedirectUrlBuilder.cpp b/src/utils/api/ApiKeyRedirectUrlBuilder.cpp index fe0c15c5..ebff6e27 100644 --- a/src/utils/api/ApiKeyRedirectUrlBuilder.cpp +++ b/src/utils/api/ApiKeyRedirectUrlBuilder.cpp @@ -31,7 +31,7 @@ namespace UKControllerPluginUtils::Api { auto ApiKeyRedirectUrlBuilder::BuildUrl(const std::string& host, int port) const -> std::string { const auto redirectUrl = "http://" + host + ":" + std::to_string(port); - return impl->settings.Url() + "/admin/user-create-api-key/?redirect=" + + return impl->settings.Url() + "/user-create-api-key/?redirect=" + curl_easy_escape(impl->curlHandle, redirectUrl.c_str(), redirectUrl.size()); } } // namespace UKControllerPluginUtils::Api From af26ab25d590e2082c1513cb5ad3e3c64627ab2d Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Tue, 30 Apr 2024 21:05:39 +0100 Subject: [PATCH 2/2] test: fix test --- test/utils/api/ApiKeyRedirectUrlBuilderTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/api/ApiKeyRedirectUrlBuilderTest.cpp b/test/utils/api/ApiKeyRedirectUrlBuilderTest.cpp index ea9c678b..de486a4e 100644 --- a/test/utils/api/ApiKeyRedirectUrlBuilderTest.cpp +++ b/test/utils/api/ApiKeyRedirectUrlBuilderTest.cpp @@ -18,7 +18,7 @@ namespace UKControllerPluginUtilsTest::Api { TEST_F(ApiKeyRedirectUrlBuilderTest, ItReturnsUrl) { EXPECT_EQ( - "https://vatsim.uk/admin/user-create-api-key/?redirect=http%3A%2F%2Flocalhost%3A62134", + "https://vatsim.uk/user-create-api-key/?redirect=http%3A%2F%2Flocalhost%3A62134", builder.BuildUrl("localhost", 62134)); } } // namespace UKControllerPluginUtilsTest::Api