diff options
author | zeripath <art27@cantab.net> | 2019-10-19 15:27:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-19 15:27:15 +0100 |
commit | 5a62ae5cbf47cf6537f6c95aba4b1d04dea5f5af (patch) | |
tree | 088421b1f75a9a0d95d182f3a5a339c66f5a9d1d /modules/auth/auth.go | |
parent | 280f4bebbf5883eef94d8a84b21575393ae5e0e1 (diff) | |
download | gitea-5a62ae5cbf47cf6537f6c95aba4b1d04dea5f5af.tar.gz gitea-5a62ae5cbf47cf6537f6c95aba4b1d04dea5f5af.zip |
Add setting to disable BASIC authentication (#8586)
Closes #8561.
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r-- | modules/auth/auth.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 624bb15cbf..1ba149f0f8 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -224,6 +224,9 @@ func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool) } if u == nil { + if !setting.Service.EnableBasicAuth { + return nil, false + } u, err = models.UserSignIn(uname, passwd) if err != nil { if !models.IsErrUserNotExist(err) { |