How to store passwords unencrypted in the database using Pow and Phoenix gen auth?

I making an app with real users.

Since its still experimental it keeps on changing its database tables, even switching between pow and gen auth to see which is better with live view for example.

I have to destroy the db and reseed the users and their data with every change. This makes their passwords invalid. So Im looking for a way to store their passwords unencrypted so I can seed them easily.

How is this done in pow and gen auth?

Hello and welcome,

You could use the unencrypted password when seeding, and let the system generates the crypted version.

How is your seed file?

Are you saying that you to store passwords in plain text from real users? This is a big NO, no matter what your reason and motivation.

What you need to do is to have code in place to handle the migration from one auth system to the other when the user logins again. This is the proper way of dealing with your problem.

3 Likes

Pow saves the password as a password_hash.

I need it to be in plain text so I can download all the user data as a csv or json, nuke the old database and then seed it in a new one. In this way, i dont need to bother making code to handle migrations.

The User seed file is just a csv with name and password

For now my alternative is to make all the passwords the same and there is no option to change passwords