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 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