Rename variable

This commit is contained in:
binwiederhier
2026-06-21 11:53:25 -04:00
parent 954fae44dc
commit 5808c4d4c0
+2 -2
View File
@@ -1719,7 +1719,7 @@ func (a *Manager) VerifyEmail(rawToken string) (*MagicLink, error) {
// validating the token (kind + expiry), it sets the user's password and deletes the link in one // validating the token (kind + expiry), it sets the user's password and deletes the link in one
// transaction. Existing access tokens are intentionally left valid (only the password changes). // transaction. Existing access tokens are intentionally left valid (only the password changes).
// Returns ErrMagicLinkNotFound if the token is invalid, expired, or not a reset token. // Returns ErrMagicLinkNotFound if the token is invalid, expired, or not a reset token.
func (a *Manager) ResetPassword(rawToken, password string) error { func (a *Manager) ResetPassword(rawToken, newPassword string) error {
m, err := a.MagicLinkByHash(hashToken(rawToken)) m, err := a.MagicLinkByHash(hashToken(rawToken))
if err != nil { if err != nil {
return err return err
@@ -1734,7 +1734,7 @@ func (a *Manager) ResetPassword(rawToken, password string) error {
if u.Provisioned { if u.Provisioned {
return ErrProvisionedUserChange // Provisioned users get their password from the config file, not reset return ErrProvisionedUserChange // Provisioned users get their password from the config file, not reset
} }
hash, err := HashPassword(password, a.config.BcryptCost) hash, err := HashPassword(newPassword, a.config.BcryptCost)
if err != nil { if err != nil {
return err return err
} }