mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-27 20:25:41 +00:00
refactor: no need to handle user escaping in verify cmd
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user