Reset a user password using CLI (#226)

This commit is contained in:
Thomas Miceli
2024-02-24 18:45:36 +01:00
parent fc9a75ce8f
commit 1c1e3a8919
8 changed files with 140 additions and 76 deletions

View File

@ -74,7 +74,7 @@ func processRegister(ctx echo.Context) error {
user := dto.ToUser()
password, err := argon2id.hash(user.Password)
password, err := utils.Argon2id.Hash(user.Password)
if err != nil {
return errorRes(500, "Cannot hash password", err)
}
@ -129,7 +129,7 @@ func processLogin(ctx echo.Context) error {
return redirect(ctx, "/login")
}
if ok, err := argon2id.verify(password, user.Password); !ok {
if ok, err := utils.Argon2id.Verify(password, user.Password); !ok {
if err != nil {
return errorRes(500, "Cannot check for password", err)
}