summaryrefslogtreecommitdiff
path: root/strava/strava.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-05 11:21:55 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-05 11:21:55 +0200
commitbef31e1d35fe88f2698cf0e3191f26a79623f66f (patch)
tree8d8e10b2a58fc4ca557f0312cfda60adfc308c30 /strava/strava.go
parent69f317d8cb51b911732712a9fcc8ac49563326c6 (diff)
feat: Add web ride library with Strava sync
Diffstat (limited to 'strava/strava.go')
-rw-r--r--strava/strava.go7
1 files changed, 7 insertions, 0 deletions
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()
}