Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Clojure Web Development Essentials

You're reading from   Clojure Web Development Essentials Develop your own web application with the effective use of the Clojure programming language

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784392222
Length 232 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ryan Baldwin Ryan Baldwin
Author Profile Icon Ryan Baldwin
Ryan Baldwin
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting Started with Luminus 2. Ring and the Ring Server FREE CHAPTER 3. Logging 4. URL Routing and Template Rendering 5. Handling Form Input 6. Testing in Clojure 7. Getting Started with the Database 8. Reading Data from the Database 9. Database Transactions 10. Sessions and Cookies 11. Environment Configuration and Deployment A. Using Korma – a Clojure DSL for SQL Index

Extending the application: brief requirements

With that, it's time to put it all in practice and extend our application. The requirements for this extension are simple. We want to:

  1. Restrict the /albums/recently-added routes (both the GET and POST) to only authenticated users.
  2. We want to give the user the option for us to remember their username for future authentications.
  3. We want to have a logout link that kills the user's session, and then prohibits them from gaining access to restricted routes until they re-authenticate.

If we break this down, there are a few work items for us. We need to create a login form that we'll use to get the user's credentials to authenticate, which should take the place of item 1. We can also satisfy item 2 by putting a classic Remember my username checkbox on the authentication form as well. Finally, we'll need to put a logout link somewhere on our site. No problemo! Let's get cracking!

Creating the login form

We're going to build...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image