Redacting login args immediately
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Brandon Watson 2023-09-15 14:57:55 -05:00
parent 1cb9710188
commit f32d3f1668

View File

@ -86,6 +86,12 @@ var cmdLogin = &commands.FullHandler{
}
func fnLogin(ce *WrappedCommandEvent) {
if ce.Args != nil && len(ce.Args) > 0 {
_, err := ce.Bot.RedactEvent(ce.RoomID, ce.EventID)
if err != nil {
ce.User.log.Errorln("Failed to redact auth token")
}
}
if ce.User.Client != nil {
if ce.User.IsConnected() {
ce.Reply("You're already logged in")
@ -100,8 +106,6 @@ func fnLogin(ce *WrappedCommandEvent) {
return
}
defer ce.Bot.RedactEvent(ce.RoomID, ce.EventID)
err := ce.User.Login(ce.Args[0])
if err != nil {
ce.Reply("Failed to log in: %v", err)