Changeset 753 in code for trunk/downstream.go


Ignore:
Timestamp:
Dec 7, 2021, 8:40:02 AM (4 years ago)
Author:
contact
Message:

Improve error message when downstream doesn't authenticate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r751 r753  
    12371237        dc.password = ""
    12381238        if dc.user == nil {
     1239                if password == "" {
     1240                        if dc.caps["sasl"] {
     1241                                return ircError{&irc.Message{
     1242                                        Command: "FAIL",
     1243                                        Params:  []string{"*", "ACCOUNT_REQUIRED", "Authentication required"},
     1244                                }}
     1245                        } else {
     1246                                return ircError{&irc.Message{
     1247                                        Command: irc.ERR_PASSWDMISMATCH,
     1248                                        Params:  []string{dc.nick, "Authentication required"},
     1249                                }}
     1250                        }
     1251                }
     1252
    12391253                if err := dc.authenticate(ctx, dc.rawUsername, password); err != nil {
    12401254                        dc.logger.Printf("PASS authentication error for user %q: %v", dc.rawUsername, err)
    12411255                        return ircError{&irc.Message{
    12421256                                Command: irc.ERR_PASSWDMISMATCH,
    1243                                 Params:  []string{"*", authErrorReason(err)},
     1257                                Params:  []string{dc.nick, authErrorReason(err)},
    12441258                        }}
    12451259                }
Note: See TracChangeset for help on using the changeset viewer.