@@ -209,7 +209,7 @@ func (c *OAuth2Connector) CompleteWithState(ctx context.Context, r *http.Request
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("cannot post token URL: %w", err)
|
||||
}
|
||||
defer tokenResp.Body.Close()
|
||||
defer func() { _ = tokenResp.Body.Close() }()
|
||||
|
||||
if tokenResp.StatusCode != http.StatusOK {
|
||||
return nil, nil, fmt.Errorf("token response status: %d", tokenResp.StatusCode)
|
||||
|
||||
@@ -73,11 +73,11 @@ func (c SlackConnection) MarshalJSON() ([]byte, error) {
|
||||
WebhookURL string `json:"webhook_url,omitempty"`
|
||||
}{
|
||||
Type: string(ProtocolOAuth2),
|
||||
AccessToken: c.OAuth2Connection.AccessToken,
|
||||
RefreshToken: c.OAuth2Connection.RefreshToken,
|
||||
ExpiresAt: c.OAuth2Connection.ExpiresAt,
|
||||
TokenType: c.OAuth2Connection.TokenType,
|
||||
Scope: c.OAuth2Connection.Scope,
|
||||
AccessToken: c.AccessToken,
|
||||
RefreshToken: c.RefreshToken,
|
||||
ExpiresAt: c.ExpiresAt,
|
||||
TokenType: c.TokenType,
|
||||
Scope: c.Scope,
|
||||
WebhookURL: c.Settings.WebhookURL,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user