mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-14 03:24:04 +00:00
24 lines
463 B
Elixir
24 lines
463 B
Elixir
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, [])
|
|
|
|
params = %{
|
|
name: name,
|
|
nickname: nickname,
|
|
email: email,
|
|
password: password,
|
|
password_confirmation: password,
|
|
bio: bio
|
|
}
|
|
|
|
user = User.register_changeset(%User{}, params)
|
|
|
|
Repo.insert!(user)
|
|
end
|
|
end
|