Skip to content

Commit

Permalink
Rewriting some _old_ code around the handlePASS method
Browse files Browse the repository at this point in the history
It seems to me it never worked like it should have.
  • Loading branch information
fclairamb committed Feb 25, 2024
1 parent 4054ae2 commit c0d4f26
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions handle_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,22 @@ func (c *clientHandler) handlePASS(param string) error {
}

switch {
case err == nil:
if msg == "" {
msg = "Password ok, continue"
}

c.writeMessage(StatusUserLoggedIn, msg)
case err == nil && c.driver == nil:
c.writeMessage(StatusNotLoggedIn, "Unexpected exception (driver is nil)")

Check warning on line 70 in handle_auth.go

View check run for this annotation

Codecov / codecov/patch

handle_auth.go#L69-L70

Added lines #L69 - L70 were not covered by tests
c.disconnect()
case err != nil:
if msg == "" {
msg = fmt.Sprintf("Authentication error: %v", err)
}

c.writeMessage(StatusNotLoggedIn, msg)
c.disconnect()
default:
c.writeMessage(StatusNotLoggedIn, "Unexpected exception (driver is nil)")
c.disconnect()
case err == nil:
if msg == "" {
msg = "Password ok, continue"
}

c.writeMessage(StatusUserLoggedIn, msg)
}

return nil
Expand Down

0 comments on commit c0d4f26

Please sign in to comment.