You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-06-15 00:15:00 +02:00
Support context in providers (#519)
Co-authored-by: Henry Jenkins <henry@henryjenkins.name>
This commit is contained in:
committed by
Henry Jenkins
parent
53d8e99f05
commit
e642daef4e
@ -1,6 +1,7 @@
|
||||
package providers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
@ -14,6 +15,8 @@ type NextcloudProvider struct {
|
||||
*ProviderData
|
||||
}
|
||||
|
||||
var _ Provider = (*NextcloudProvider)(nil)
|
||||
|
||||
// NewNextcloudProvider initiates a new NextcloudProvider
|
||||
func NewNextcloudProvider(p *ProviderData) *NextcloudProvider {
|
||||
p.ProviderName = "Nextcloud"
|
||||
@ -27,8 +30,8 @@ func getNextcloudHeader(accessToken string) http.Header {
|
||||
}
|
||||
|
||||
// GetEmailAddress returns the Account email address
|
||||
func (p *NextcloudProvider) GetEmailAddress(s *sessions.SessionState) (string, error) {
|
||||
req, err := http.NewRequest("GET",
|
||||
func (p *NextcloudProvider) GetEmailAddress(ctx context.Context, s *sessions.SessionState) (string, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET",
|
||||
p.ValidateURL.String(), nil)
|
||||
if err != nil {
|
||||
logger.Printf("failed building request %s", err)
|
||||
|
Reference in New Issue
Block a user