Skip to content

Commit

Permalink
verify user password updated
Browse files Browse the repository at this point in the history
  • Loading branch information
iqquee committed Mar 12, 2022
1 parent c9c13f0 commit 72752c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func SignIn(c *gin.Context) {
return
}

passwordIsValid, msg := utils.VerifyPassword(foundUser.Password, user.Password)
passwordIsValid, msg := utils.VerifyPassword(user.Password, foundUser.Password)
if !passwordIsValid {
c.JSON(http.StatusInternalServerError, gin.H{"error": msg})
return
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func HashPassword(password string) string {
return string(bytes)
}

func VerifyPassword(providedPassword string, userPassword string) (bool, string) {
func VerifyPassword(userPassword string, providedPassword string) (bool, string) {
err := bcrypt.CompareHashAndPassword([]byte(providedPassword), []byte(userPassword))
check := true
msg := ""
Expand Down

0 comments on commit 72752c7

Please sign in to comment.