mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 03:22:20 +00:00
I am an idiot, don't let only people with the *wrong* password stream
This commit is contained in:
parent
79f52ed880
commit
34652f8f3e
@ -45,12 +45,12 @@ func (a LDAP) Login(username string, password string) (bool, string, error) {
|
||||
log.Printf("[LDAP] Logging to %s...", bindDn)
|
||||
err = a.Conn.Bind(bindDn, password)
|
||||
if err == nil {
|
||||
log.Printf("[LDAP] Logging failed: %s", err)
|
||||
// Login succeeded if no error
|
||||
return true, aliasSplit[0], nil
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("[LDAP] Logging failed: %s", err)
|
||||
// Unable to log in
|
||||
return err == nil, "", err
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ func Serve(streams *messaging.Streams, authBackend auth.Backend, cfg *Options) {
|
||||
if authBackend != nil {
|
||||
// check password
|
||||
ok, username, err := authBackend.Login(name, password)
|
||||
if ok || err != nil {
|
||||
if !ok || err != nil {
|
||||
log.Printf("Failed to authenticate for stream %s", name)
|
||||
s.Close()
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user