Last active
December 20, 2015 01:19
-
-
Save manutter51/6048531 to your computer and use it in GitHub Desktop.
Restricting access for sensitive pages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns share-for-all.routes.auth | |
;; ... | |
(:require ;; ... | |
[cemerick.friend :as friend] | |
(cemerick.friend [workflows :as workflows] | |
[credentials :as creds]))) | |
;; ... | |
(defroutes secured-routes | |
(GET "/register" req | |
(layout/render "auth/register.html")) | |
(GET "/login" [] | |
(layout/render "auth/login.html")) | |
(POST "/login" [email pass] | |
(login email pass)) | |
(POST "/register" [email pass pass1] | |
(register email pass pass1))) | |
(defroutes auth-routes | |
(friend/requires-scheme secured-routes | |
:https | |
{:https 3334}) | |
(GET "/logout" [] | |
(logout)) | |
(POST "/logout" [] | |
(logout))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment