Skip to content

Commit

Permalink
GetOAuthToken is a standalone function
Browse files Browse the repository at this point in the history
Should have never been part of Slack.
  • Loading branch information
nlopes committed Jan 24, 2015
1 parent 1b96f65 commit 8dabf1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ type oAuthResponseFull struct {
SlackResponse
}

func (api *Slack) GetOAuthToken(clientId, clientSecret, code, redirectUri string) (accessToken string, scope string, err error) {
func GetOAuthToken(clientId, clientSecret, code, redirectUri string, debug bool) (accessToken string, scope string, err error) {
values := url.Values{
"client_id": {clientId},
"client_secret": {clientSecret},
"code": {code},
"redirect_uri": {redirectUri},
}
response := &oAuthResponseFull{}
err = ParseResponse("oauth.access", values, response, api.debug)
err = ParseResponse("oauth.access", values, response, debug)
if err != nil {
return "", "", err
}
Expand Down

0 comments on commit 8dabf1c

Please sign in to comment.