Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module allows you to use the auth snaplet with your user database stored in a Redis instance.
In your initializer you'll need something like:
a <- nestSnaplet "auth" auth $ initRedisAuthManager defAuthSettings sess defaultConnectInfo
Redis Key Space
The following keys are used to store the user information in Redis. Be sure to avoid key collisions within your applications.
- next.userId - Int representing the next spare userId.
- user:[username] (eg. user:bob) - Hash of the user fields for user bob.
- userid:[userId] (eg. userid:2 - bob) - Stores username for userId based lookup.
- useremail:[email] (eg. useremail:bob@example.com - bob) - Stores email for lookup
- usertoken:[usertoken] (eg. usertoken:XXXXXXXX - bob) - Remember Token based user lookup.
Synopsis
- initRedisAuthManager :: SnapletLens b SessionManager -> RedisDB -> SnapletInit b (AuthManager b)
Documentation
:: SnapletLens b SessionManager | Lens into a |
-> RedisDB | Redis ConnectInfo |
-> SnapletInit b (AuthManager b) |
Initialize a Redis backed AuthManager