I’m starting doing a small app to learn about Elixir and Phoenix and.
In my app, I would like to have a User schema with name, email, password and a field to set a role for the user.
To handle the auth stuff I was thinking about using #pow and following the documentation I was able to register a user into an app, so far so good. When I register a new user through the view I just need to set an email and a password (this password will be manipulated to create a password_hash field and be set on the database) and by default, I set this user as a “regular_user” as role.
My problem/question is, how can I create a user directly using
iex -S mix to set it as an admin?
I got stuck when I try to create using
iex -S mix because I was not able to set the password_hash field.
I don’t want to use a form view to create an
admin user because I want only a single user as admin, just wanna use the form to register new
regular users into my app.