Skip to content

Instantly share code, notes, and snippets.

@dmozzy
Created May 11, 2012 14:10
Show Gist options
  • Save dmozzy/2659909 to your computer and use it in GitHub Desktop.
Save dmozzy/2659909 to your computer and use it in GitHub Desktop.
Adding Google Authentication
;Middleware to add authentication
(defn require-login [application]
(fn [request]
(if
(aeu/user-logged-in?)
(application request)
(ring-response/redirect
(aeu/login-url))
)))
;Adding the middleware to the app
(def app (require-login (comp-handler/api geotasklist-main-handler)))
;Defining the app
(ae/def-appengine-app geotasklist-app (var app))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment