Fail when provided credentials are wrong and actually use default group.

This commit is contained in:
Stanislav Nikitin 2019-09-08 00:34:44 +05:00
parent c30906ba8c
commit e98751b518
No known key found for this signature in database
GPG Key ID: 106900B32F8192EE

View File

@ -133,10 +133,14 @@ func main() {
log.Printf("Password stored in database: %s, we hashed: %s (pre: %s)\n", dbData.Password, saltedPassHash, passHash) log.Printf("Password stored in database: %s, we hashed: %s (pre: %s)\n", dbData.Password, saltedPassHash, passHash)
} }
if dbData.Password != saltedPassHash {
os.Exit(1)
}
// Check groups mapping. // Check groups mapping.
// This is temporary, in future versions all groups memberships // This is temporary, in future versions all groups memberships
// should be managed on FUDForum side. // should be managed on FUDForum side.
var group string group := configuration.Cfg.Groups.Default
for _, groupMapping := range configuration.Cfg.Groups.Groups { for _, groupMapping := range configuration.Cfg.Groups.Groups {
var userFound bool var userFound bool
for _, user := range groupMapping.Users { for _, user := range groupMapping.Users {