mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 11:19:19 +00:00
22 lines
446 B
Elixir
22 lines
446 B
Elixir
defmodule Mix.Tasks.RegisterUser do
|
|
use Mix.Task
|
|
alias Pleroma.{Repo, User}
|
|
|
|
@shortdoc "Register user"
|
|
def run([name, nickname, email, bio, password]) do
|
|
Mix.Task.run("app.start")
|
|
|
|
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
|