diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-23 18:19:45 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-23 18:19:45 +0100 |
| commit | 2da03b735517a034a5b369550036c853a7dad819 (patch) | |
| tree | 2c039dd46b43395d60a2fa8159886596f4ef6286 /src/oauth.go | |
| parent | 40053552852cf8c27fe7658b64df001d65b0a65e (diff) | |
Run gofumpt
Diffstat (limited to 'src/oauth.go')
| -rw-r--r-- | src/oauth.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/oauth.go b/src/oauth.go index 291a409..92c64d4 100644 --- a/src/oauth.go +++ b/src/oauth.go @@ -19,7 +19,6 @@ import ( // client. func genState() (string, error) { randomBytes, err := MakeRandomByteSlice(32) - if err != nil { return "", &OAuthGenStateUnableError{Err: err} } @@ -120,7 +119,8 @@ func (oauth *OAuth) getTokensWithAuthCode(authCode string) error { "redirect_uri": {"http://127.0.0.1:8000/callback"}, } headers := &http.Header{ - "content-type": {"application/x-www-form-urlencoded"}} + "content-type": {"application/x-www-form-urlencoded"}, + } opts := &HTTPOptionalParams{Headers: headers, Body: data} current_time := generateTimeSeconds() _, body, bodyErr := HTTPPostWithOpts(reqURL, opts) @@ -157,7 +157,8 @@ func (oauth *OAuth) getTokensWithRefresh() error { "grant_type": {"refresh_token"}, } headers := &http.Header{ - "content-type": {"application/x-www-form-urlencoded"}} + "content-type": {"application/x-www-form-urlencoded"}, + } opts := &HTTPOptionalParams{Headers: headers, Body: data} current_time := generateTimeSeconds() _, body, bodyErr := HTTPPostWithOpts(reqURL, opts) @@ -210,7 +211,6 @@ func (oauth *OAuth) Callback(w http.ResponseWriter, req *http.Request) { // Now that we have obtained the authorization code, we can move to the next step: // Obtaining the access and refresh tokens err := oauth.getTokensWithAuthCode(extractedCode) - if err != nil { oauth.Session.CallbackError = &OAuthFailedCallbackGetTokensError{Err: err} go oauth.Session.Server.Shutdown(oauth.Session.Context) |
