diff options
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/auth.go | 4 | ||||
-rw-r--r-- | modules/auth/auth_form.go | 2 | ||||
-rw-r--r-- | modules/auth/oauth2/oauth2.go | 12 |
3 files changed, 10 insertions, 8 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 4a31ff944e..33ba777966 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -179,7 +179,7 @@ func AssignForm(form interface{}, data map[string]interface{}) { func getRuleBody(field reflect.StructField, prefix string) string { for _, rule := range strings.Split(field.Tag.Get("binding"), ";") { if strings.HasPrefix(rule, prefix) { - return rule[len(prefix): len(rule) - 1] + return rule[len(prefix) : len(rule)-1] } } return "" @@ -237,7 +237,7 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro } if errs[0].FieldNames[0] == field.Name { - data["Err_" + field.Name] = true + data["Err_"+field.Name] = true trName := field.Tag.Get("locale") if len(trName) == 0 { diff --git a/modules/auth/auth_form.go b/modules/auth/auth_form.go index 5dae55c1ef..338be53457 100644 --- a/modules/auth/auth_form.go +++ b/modules/auth/auth_form.go @@ -37,7 +37,7 @@ type AuthenticationForm struct { SkipVerify bool PAMServiceName string Oauth2Provider string - Oauth2Key string + Oauth2Key string Oauth2Secret string } diff --git a/modules/auth/oauth2/oauth2.go b/modules/auth/oauth2/oauth2.go index bf486d5a0b..ca4cde73b6 100644 --- a/modules/auth/oauth2/oauth2.go +++ b/modules/auth/oauth2/oauth2.go @@ -5,16 +5,18 @@ package oauth2 import ( - "code.gitea.io/gitea/modules/setting" + "net/http" + "os" + "path/filepath" + "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/setting" + "github.com/gorilla/sessions" "github.com/markbates/goth" "github.com/markbates/goth/gothic" - "net/http" - "os" - "github.com/satori/go.uuid" - "path/filepath" "github.com/markbates/goth/providers/github" + "github.com/satori/go.uuid" ) var ( |