Permalink
Browse files

Add support for new AuthUser fields

  • Loading branch information...
ozataman committed Jan 9, 2011
1 parent 7aa36b4 commit 277ab64c91a84278f133aee0ef8d22732b62365c
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/Snap/Extension/DB/MongoDB.hs
@@ -267,6 +267,10 @@ docToAuthUser v = do
, userSuspendedAt = DB.lookup "suspended_at" v
, userCreatedAt = DB.lookup "created_at" v
, userUpdatedAt = DB.lookup "updated_at" v
+ , userCurrentLoginAt = DB.lookup "current_login_at" v
+ , userLastLoginAt = DB.lookup "last_login_at" v
+ , userCurrentLoginIp = DB.lookup "current_login_ip" v
+ , userLastLoginIp = DB.lookup "last_login_ip" v
, userLoginCount = maybe 0 id $ DB.lookup "login_count" v
, userFailedLoginCount = maybe 0 id $ DB.lookup "failed_login_count" v
}
@@ -289,6 +293,10 @@ authUserToDoc usr = fields'
, Just $ ("salt" =: userSalt usr)
, Just $ ("activated_at" =: userActivatedAt usr)
, Just $ ("suspended_at" =: userSuspendedAt usr)
+ , Just $ ("current_login_at" =: userCurrentLoginAt usr)
+ , Just $ ("last_login_at" =: userLastLoginAt usr)
+ , Just $ ("current_login_ip" =: userCurrentLoginIp usr)
+ , Just $ ("last_login_ip" =: userLastLoginIp usr)
, Just $ ("login_count" =: userLoginCount usr)
, Just $ ("failed_login_count" =: userFailedLoginCount usr)
]

0 comments on commit 277ab64

Please sign in to comment.