Fix lint
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
966e4d6ed6
commit
1eb4b15cb0
|
@ -40,6 +40,7 @@ type Token struct {
|
|||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
// NewUserAuthTokenResponse creates a new user auth token response from a user object.
|
||||
func NewUserAuthTokenResponse(u *user.User, c echo.Context) error {
|
||||
t, err := NewUserJWTAuthtoken(u)
|
||||
if err != nil {
|
||||
|
|
|
@ -37,12 +37,13 @@ import (
|
|||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
// Callback contains the callback after an auth request was made and redirected
|
||||
type Callback struct {
|
||||
Code string `query:"code" json:"code"`
|
||||
Scope string `query:"scop" json:"scope"`
|
||||
State string `query:"state" json:"state"`
|
||||
}
|
||||
|
||||
// Provider is the structure of an OpenID Connect provider
|
||||
type Provider struct {
|
||||
Name string `json:"name"`
|
||||
Key string `json:"key"`
|
||||
|
@ -68,6 +69,7 @@ func getKeyFromName(name string) string {
|
|||
return reg.ReplaceAllString(strings.ToLower(name), "")
|
||||
}
|
||||
|
||||
// GetAllProviders returns all configured providers
|
||||
func GetAllProviders() (providers []*Provider, err error) {
|
||||
rawProvider := config.AuthOpenIDProviders.Get().([]interface{})
|
||||
|
||||
|
@ -125,6 +127,7 @@ func getProviderFromMap(pi map[interface{}]interface{}) (*Provider, error) {
|
|||
return provider, nil
|
||||
}
|
||||
|
||||
// GetProvider retrieves a provider from keyvalue
|
||||
func GetProvider(key string) (*Provider, error) {
|
||||
rawProvider := config.AuthOpenIDProviders.Get().([]interface{})
|
||||
|
||||
|
@ -140,6 +143,7 @@ func GetProvider(key string) (*Provider, error) {
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
// HandleCallback handles the auth request callback after redirecting from the provider with an auth code
|
||||
func HandleCallback(c echo.Context) error {
|
||||
cb := &Callback{}
|
||||
if err := c.Bind(cb); err != nil {
|
||||
|
|
Loading…
Reference in New Issue