# `AshAuthentication.Strategy.Password.HashPasswordChange`
[🔗](https://github.com/team-alembic/ash_authentication/blob/main/lib/ash_authentication/strategies/password/hash_password_change.ex#L5)

Set the hash based on the password input.

Uses the configured `AshAuthentication.HashProvider` to generate a hash of the
user's password input and store it in the changeset.

You can use this change in your actions where you want to change the user's
password.  If you're not using one of the actions generated by the password
strategy then you'll need to manually pass the strategy name in the changeset
context.  Eg:

```elixir
Changeset.new(user, %{})
|> Changeset.set_context(%{strategy_name: :password})
|> Changeset.for_update(:update, params)
|> Accounts.update()
```

or by adding it statically to your action definition:

```elixir
update :change_password do
  change set_context(%{strategy_name: :password})
  change AshAuthentication.Strategy.Password.HashPasswordChange
end
```

or by adding it as an option to the change definition:

```elixir
update :change_password do
  change {AshAuthentication.Strategy.Password.HashPasswordChange, strategy_name: :password}
end
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
