From e1dcbda4ec1cdc83e0e5cea951a7f167925d559e Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 6 Oct 2025 21:26:31 +0300 Subject: [PATCH] refactor: no need to handle user escaping in verify cmd --- cmd/verify.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmd/verify.go b/cmd/verify.go index 2e7d234..93b6a99 100644 --- a/cmd/verify.go +++ b/cmd/verify.go @@ -2,7 +2,6 @@ package cmd import ( "errors" - "strings" "tinyauth/internal/utils" "github.com/charmbracelet/huh" @@ -96,14 +95,7 @@ func (c *verifyUserCmd) run(cmd *cobra.Command, args []string) { log.Fatal().Msg("Username is incorrect") } - var passwd string - if strings.Contains(user.Password, "$$") { - passwd = strings.ReplaceAll(user.Password, "$$", "$") - } else { - passwd = c.password - } - - err = bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(passwd)) + err = bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(c.password)) if err != nil { log.Fatal().Msg("Password is incorrect") }