X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fmix%2Ftasks%2Fregister_user.ex;h=4bec6b9d9c5c59f471b7e4d295a0d6f964b02fbd;hb=678fed47ee0b7e458d3324bea0c1171322d29b5f;hp=e2f36c34cf4a6f6356f2cccec50fb6bcb42fd9a6;hpb=8f43992121a726df2faaf04bf918f32f708d10f8;p=akkoma diff --git a/lib/mix/tasks/register_user.ex b/lib/mix/tasks/register_user.ex index e2f36c34c..4bec6b9d9 100644 --- a/lib/mix/tasks/register_user.ex +++ b/lib/mix/tasks/register_user.ex @@ -5,16 +5,18 @@ defmodule Mix.Tasks.RegisterUser do @shortdoc "Register user" def run([name, nickname, email, bio, password]) do - ensure_started(Repo, []) - user = %User{ + Mix.Task.run("app.start") + + params = %{ name: name, nickname: nickname, email: email, - password_hash: Comeonin.Pbkdf2.hashpwsalt(password), + password: password, + password_confirmation: password, bio: bio } - user = %{ user | ap_id: User.ap_id(user) } + user = User.register_changeset(%User{}, params) Repo.insert!(user) end