Ethan Koenig 1 year ago
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

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

+ 1 - 1
models/login_source.go

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

+ 6 - 6
models/oauth2.go

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

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

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