Browse Source

gofmt (#1662)

for-closed-social
Ethan Koenig 7 years ago
committed by Lunny Xiao
parent
commit
a5f28a4544
4 changed files with 10 additions and 10 deletions
  1. +2
    -2
      models/error_oauth2.go
  2. +1
    -1
      models/login_source.go
  3. +6
    -6
      models/oauth2.go
  4. +1
    -1
      routers/api/v1/misc/version.go

+ 2
- 2
models/error_oauth2.go View File

@ -9,8 +9,8 @@ import "fmt"
// ErrOpenIDConnectInitialize represents a "OpenIDConnectInitialize" kind of error. // ErrOpenIDConnectInitialize represents a "OpenIDConnectInitialize" kind of error.
type ErrOpenIDConnectInitialize struct { type ErrOpenIDConnectInitialize struct {
OpenIDConnectAutoDiscoveryURL string OpenIDConnectAutoDiscoveryURL string
ProviderName string
Cause error
ProviderName string
Cause error
} }
// IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist. // IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist.

+ 1
- 1
models/login_source.go View File

@ -685,4 +685,4 @@ func UserSignIn(username, password string) (*User, error) {
} }
return nil, ErrUserNotExist{user.ID, user.Name, 0} return nil, ErrUserNotExist{user.ID, user.Name, 0}
}
}

+ 6
- 6
models/oauth2.go View File

@ -6,15 +6,16 @@ package models
import ( import (
"sort" "sort"
"code.gitea.io/gitea/modules/auth/oauth2" "code.gitea.io/gitea/modules/auth/oauth2"
) )
// OAuth2Provider describes the display values of a single OAuth2 provider // OAuth2Provider describes the display values of a single OAuth2 provider
type OAuth2Provider struct { type OAuth2Provider struct {
Name string
DisplayName string
Image string
CustomURLMapping *oauth2.CustomURLMapping
Name string
DisplayName string
Image string
CustomURLMapping *oauth2.CustomURLMapping
} }
// OAuth2Providers contains the map of registered OAuth2 providers in Gitea (based on goth) // OAuth2Providers contains the map of registered OAuth2 providers in Gitea (based on goth)
@ -47,7 +48,7 @@ var OAuth2Providers = map[string]OAuth2Provider{
// OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls // OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls
// key is used to map the OAuth2Provider // key is used to map the OAuth2Provider
// value is the mapping as defined for the OAuth2Provider // value is the mapping as defined for the OAuth2Provider
var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping {
var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{
"github": OAuth2Providers["github"].CustomURLMapping, "github": OAuth2Providers["github"].CustomURLMapping,
"gitlab": OAuth2Providers["gitlab"].CustomURLMapping, "gitlab": OAuth2Providers["gitlab"].CustomURLMapping,
} }
@ -119,4 +120,3 @@ func wrapOpenIDConnectInitializeError(err error, providerName string, oAuth2Conf
} }
return err return err
} }

+ 1
- 1
routers/api/v1/misc/version.go View File

@ -23,6 +23,6 @@ func Version(ctx *context.APIContext) {
// //
// Responses: // Responses:
// 200: ServerVersion // 200: ServerVersion
ctx.JSON(200, &gitea.ServerVersion{Version: setting.AppVer}) ctx.JSON(200, &gitea.ServerVersion{Version: setting.AppVer})
} }

Loading…
Cancel
Save