From 901f65361a39edc661c8ad66b3555d29c1aa0917 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 13 Nov 2025 14:31:33 +0000 Subject: [PATCH] Don't pass the redirect URI through It's always the same, might as well just get it where we need it. --- arcgis.go | 4 ++-- endpoint.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arcgis.go b/arcgis.go index 06f34c12..5475680d 100644 --- a/arcgis.go +++ b/arcgis.go @@ -56,12 +56,12 @@ type OAuthTokenResponse struct { } // Build the ArcGIS authorization URL with PKCE -func buildArcGISAuthURL(clientID string, redirectURI string, expiration int) string { +func buildArcGISAuthURL(clientID string, expiration int) string { baseURL := "https://www.arcgis.com/sharing/rest/oauth2/authorize/" params := url.Values{} params.Add("client_id", clientID) - params.Add("redirect_uri", redirectURI) + params.Add("redirect_uri", redirectURL()) params.Add("response_type", "code") //params.Add("code_challenge", generateCodeChallenge(codeVerifier)) //params.Add("code_challenge_method", "S256") diff --git a/endpoint.go b/endpoint.go index c59e40e2..f73cf8dc 100644 --- a/endpoint.go +++ b/endpoint.go @@ -13,7 +13,7 @@ import ( func getArcgisOauthBegin(w http.ResponseWriter, r *http.Request) { expiration := 60 - authURL := buildArcGISAuthURL(ClientID, redirectURL(), expiration) + authURL := buildArcGISAuthURL(ClientID, expiration) http.Redirect(w, r, authURL, http.StatusFound) }