From bef31e1d35fe88f2698cf0e3191f26a79623f66f Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 5 Aug 2026 11:21:55 +0200 Subject: feat: Add web ride library with Strava sync --- strava/strava.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'strava/strava.go') diff --git a/strava/strava.go b/strava/strava.go index d394791..c7a84d0 100644 --- a/strava/strava.go +++ b/strava/strava.go @@ -30,12 +30,19 @@ type Token struct { } func AuthorizeURL(clientID, redirectURI string) string { + return AuthorizeURLWithState(clientID, redirectURI, "") +} + +func AuthorizeURLWithState(clientID, redirectURI, state string) string { q := url.Values{} q.Set("client_id", clientID) q.Set("response_type", "code") q.Set("redirect_uri", redirectURI) q.Set("approval_prompt", "auto") q.Set("scope", "activity:read_all") + if state != "" { + q.Set("state", state) + } return AuthURL + "?" + q.Encode() } -- cgit v1.2.3