Permalink
Browse files

Extract user-info.

  • Loading branch information...
1 parent ad198c7 commit 3739669241986e1ff938191bdb9d09616b000b34 @duelinmarkers committed Mar 30, 2009
Showing with 6 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +5 −3 src/appengine_clj/users.clj
View
@@ -1,2 +1,3 @@
+*.swp
appengine-clj.jar
classes
@@ -3,9 +3,11 @@
(com.google.appengine.api.users User UserService UserServiceFactory)))
+(defn user-info []
+ (let [user-service (UserServiceFactory/getUserService)]
+ {:user (.getCurrentUser user-service) :user-service user-service}))
+
(defn wrap-with-user-info [application]
(fn [request]
- (let [user-service (UserServiceFactory/getUserService)
- user (.getCurrentUser user-service)]
- (application (assoc request :appengine-clj/user-info {:user user :user-service user-service})))))
+ (application (assoc request :appengine-clj/user-info (user-info)))))

0 comments on commit 3739669

Please sign in to comment.