riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 21 forks source link

Default user #14

Closed lachezar closed 7 years ago

lachezar commented 7 years ago

It would be a good idea to have either a default user that is created upon installation or a mix task to create such a user.

Right now I had to comment out the plug Phauxth.Authenticate in the router.ex to bypass the authentication so that I can create an account the very first time.

riverrun commented 7 years ago

Maybe I am misunderstanding what you want to do, but you could generate users in the repo/seeds.exs file. There's more info about that here.

lachezar commented 7 years ago

This is more of a "nice to have" feature.

I was thinking about a quick way to generate a user with a proper password hash (something similar to Django's admin). Otherwise you have to figure out for yourself how to compute the bcrypt password hash.

riverrun commented 7 years ago

I've updated the New project page with information about how you can create users by editing the priv/repo/seeds.exs file. If you have any suggestions for making this clearer, please let me know.

lachezar commented 7 years ago

Thanks, that should help a lot for newcomers :)

riverrun commented 7 years ago

Just a note to say that I've changed how I've organized this, and now the installer installs an example priv/repo/seeds.exs file. The New project page lets developers know that this file needs editing.