Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content