diff options
Diffstat (limited to 'strava/strava.go')
| -rw-r--r-- | strava/strava.go | 7 |
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() } |