Adding User Management

Before we can move forward, we need to address the user management aspect of our application. We’ll start by implementing the service endpoints for user registration and authentication. From there, we’ll build the corresponding UI components.

Service Endpoints

Let’s start by running the migration we wrote in Data Modeling, if you haven’t done so already:

 user> (​migrate​)
 ... INFO migratus.core - Starting migrations
 ...
 ... INFO migratus.core - Ending migrations
 nil
 user>

Now let’s update our queries.sql to create and look up users. Note, we need to hash and salt our password before we pass it to our insert statement, so we add an asterisk to the end of the name to denote that we shouldn’t call it directly.

Get Web Development with Clojure, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.