Code Monkey home page Code Monkey logo

Comments (6)

chevinbrown avatar chevinbrown commented on May 8, 2024 1

I will note, it'll work just fine to forgo the pow_user_fields() in my schema and do it explicitly. 😃

  schema "admin_users" do
    field :email, :string
    field :password, :string, virtual: true
    field :current_password, :string, virtual: true
    field :confirm_password, :string, virtual: true
    field :password_hash, :string, [source: :encrypted_password]
end

from pow.

danschultzer avatar danschultzer commented on May 8, 2024 1

It's exactly what I'm testing out 😄 I like if it could be something as explicit. Maybe like this:

schema "admin_users" do
  field :password_hash, :string, [source: :encrypted_password]

  pow_user_fields()
end

And the pow_user_fields/0 will just ignore that field (the Ecto field/3 macro registers a module attribute with all the fields so would be easy enough to ignore).

from pow.

danschultzer avatar danschultzer commented on May 8, 2024

Would you need to keep both the rails and phoenix app running at the same time? If not, then I think the best would be to create a migration to rename the column.

It would be pretty easy to add a password_hash_field like the existing user_id_field configuration, but I'll check if there is a better way of handling this situation.

from pow.

chevinbrown avatar chevinbrown commented on May 8, 2024

Yes, we'd be going for the incremental migration--pulling over individual contexts one at a time, while keeping more complex logic that's established in the rails app--smaller surface area gets moved first, then we'll step up slowly over time as the phoenix app is proved stable.

I believe a lot of rails apps will be taking this approach (and migrating from devise).

from pow.

danschultzer avatar danschultzer commented on May 8, 2024

I've got a PR up: #21

from pow.

chevinbrown avatar chevinbrown commented on May 8, 2024

I approve. 👏

from pow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.