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