mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add common type for oauth authorization errors
This commit is contained in:
@@ -2,7 +2,6 @@ package social
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
@@ -21,11 +20,8 @@ type SocialGithub struct {
|
||||
}
|
||||
|
||||
var (
|
||||
ErrMissingTeamMembership = errors.New("User not a member of one of the required teams")
|
||||
)
|
||||
|
||||
var (
|
||||
ErrMissingOrganizationMembership = errors.New("User not a member of one of the required organizations")
|
||||
ErrMissingTeamMembership = &Error{"User not a member of one of the required teams"}
|
||||
ErrMissingOrganizationMembership = &Error{"User not a member of one of the required organizations"}
|
||||
)
|
||||
|
||||
func (s *SocialGithub) Type() int {
|
||||
|
||||
@@ -29,6 +29,14 @@ type SocialConnector interface {
|
||||
Client(ctx context.Context, t *oauth2.Token) *http.Client
|
||||
}
|
||||
|
||||
type Error struct {
|
||||
s string
|
||||
}
|
||||
|
||||
func (e *Error) Error() string {
|
||||
return e.s
|
||||
}
|
||||
|
||||
var (
|
||||
SocialBaseUrl = "/login/"
|
||||
SocialMap = make(map[string]SocialConnector)
|
||||
|
||||
Reference in New Issue
Block a user