Adding Comeonin to the user schema file

Now that we have Comeonin and the libraries to support bcrypting passwords in place, we need to actually hook it up to the rest of our application. This entails a few steps for us:

  1. We need to have Comeonin interact with our changesets to insert the encrypted password.
  2. We need to have the Controller check our password against the hash rather than the plaintext password.

It's pretty easy for us to implement this first step, so we'll start with this. Generally speaking, you should avoid adding any new code to your schemas unless it's something that is very specific to the shape of the data that is entering/leaving your database. Since this is taking information at the final step (just before inserting ...

Get Phoenix Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.