added nicer looking 401 error page

This commit is contained in:
Gered 2013-06-07 19:16:33 -04:00
parent e2357aaa1b
commit 8d9301368d
2 changed files with 16 additions and 1 deletions

View file

@ -30,8 +30,12 @@
(session/clear!)
(resp/redirect "/"))
(defn handle-unauthorized []
(->> (layout/render "unauthorized.html")
(resp/status 401)))
(defroutes auth-routes
(GET "/unauthorized" [] "Unauthorized.")
(GET "/unauthorized" [] (handle-unauthorized))
(GET "/login" [] (login-page))
(POST "/login" [id pass] (handle-login id pass))
(GET "/logout" [] (logout))

View file

@ -0,0 +1,11 @@
{% extends "blarg/views/templates/base.html" %}
{% block content %}
<div class="page-header">
<h2>Unauthorized</h2>
</div>
<p>You are not authorized to view that resource.</p>
{% endblock %}