Spear.reset_user_password
You're seeing just the function
reset_user_password
, go back to Spear module for more information.
Link to this function
reset_user_password(conn, login_name, new_password, opts \\ [])
View Source (since 0.3.0)Specs
reset_user_password( connection :: Spear.Connection.t(), login_name :: String.t(), new_password :: String.t(), opts :: Keyword.t() ) :: :ok | {:error, any()}
Resets a user's password
This can be only requested by a user in the $admins
group. The current
password is not passed in this request, so this function is suitable for
setting a new password when the current password is lost.
Options
All options are passed to Spear.request/5
.
Examples
iex> Spear.create_user(conn, "Aladdin", "aladdin", "changeit", ["$ops"])
:ok
iex> Spear.reset_user_password(conn, "aladdin", "open sesame", credentials: {"admin", "changeit"})
:ok