Renamed hash field to token.

This commit is contained in:
mikestefanello 2025-04-19 16:08:43 -04:00
parent cb5c3ad127
commit dae9ea3ae1
14 changed files with 136 additions and 137 deletions

View file

@ -125,7 +125,7 @@ func (c *AuthClient) GeneratePasswordResetToken(ctx echo.Context, userID int) (s
// Create and save the password reset token
pt, err := c.orm.PasswordToken.
Create().
SetHash(token).
SetToken(token).
SetUserID(userID).
Save(ctx.Request().Context())
@ -151,7 +151,7 @@ func (c *AuthClient) GetValidPasswordToken(ctx echo.Context, userID, tokenID int
case *ent.NotFoundError:
case nil:
// Check the token for a hash match
if err := c.CheckPassword(token, pt.Hash); err == nil {
if err := c.CheckPassword(token, pt.Token); err == nil {
return pt, nil
}
default:

View file

@ -10,7 +10,7 @@ import (
"entgo.io/ent/schema/field"
"github.com/labstack/echo/v4"
"github.com/mikestefanello/pagoda/ent/admin"
"github.com/mikestefanello/pagoda/pkg/pager"
"github.com/mikestefanello/pagoda/pkg/pager" // todo make this easier
"github.com/mikestefanello/pagoda/pkg/routenames"
"github.com/mikestefanello/pagoda/pkg/ui"
. "github.com/mikestefanello/pagoda/pkg/ui/components"