Commit 567ec494 authored by lain's avatar lain
Browse files

Add user registration mix task.

parent f45dc475
defmodule Mix.Tasks.RegisterUser do
use Mix.Task
import Mix.Ecto
alias Pleroma.{Repo, User}
@shortdoc "Register user"
def run([name, nickname, email, bio, password]) do
ensure_started(Repo, [])
user = %User{
name: name,
nickname: nickname,
email: email,
password_hash: Comeonin.Pbkdf2.hashpwsalt(password),
bio: bio
}
user = %{ user | ap_id: User.ap_id(user) }
Repo.insert!(user)
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment