1
0
Fork 0
forked from forgejo/forgejo

Add setting to disable BASIC authentication (#8586)

Closes #8561.
This commit is contained in:
zeripath 2019-10-19 15:27:15 +01:00 committed by GitHub
parent 280f4bebbf
commit 5a62ae5cbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View file

@ -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) {