packages feed

users 0.3.0.0 → 0.4.0.0

raw patch · 2 files changed

+16/−2 lines, 2 filesdep ~base

Dependency ranges changed: base

Files

src/Web/Users/Types.hs view
@@ -17,7 +17,6 @@     ) where -import Control.Applicative import Crypto.BCrypt import Data.Aeson import Data.Int@@ -30,16 +29,27 @@ import qualified Data.Text.Encoding as T import qualified System.IO.Unsafe as U +{-# DEPRECATED UsernameOrEmailAlreadyTaken "Please use the more specific error constructors." #-}+ -- | Errors that happen on storage level during user creation data CreateUserError    = UsernameOrEmailAlreadyTaken    | InvalidPassword+   | UsernameAlreadyTaken+   | EmailAlreadyTaken+   | UsernameAndEmailAlreadyTaken    deriving (Show, Eq) +{-# DEPRECATED UsernameOrEmailAlreadyExists "Please use the more descriptive constructors instead." #-}+{-# DEPRECATED UserDoesntExit "Please use UserDoesntExist instead." #-}+ -- | Errors that happen on storage level during user updating data UpdateUserError    = UsernameOrEmailAlreadyExists+   | UsernameAlreadyExists+   | EmailAlreadyExists    | UserDoesntExit+   | UserDoesntExist    deriving (Show, Eq)  -- | Errors that happen on storage level during token actions@@ -88,6 +98,9 @@     withAuthUser :: FromJSON a => b -> T.Text -> (User a -> Bool) -> (UserId b -> IO r) -> IO (Maybe r)     -- | Verify a 'SessionId'. The session duration can be extended by 'NominalDiffTime'     verifySession :: b -> SessionId -> NominalDiffTime -> IO (Maybe (UserId b))+    -- | Force create a session for a user. This is useful for support/admin login.+    -- If the user does not exist, this will fail.+    createSession :: b -> UserId b -> NominalDiffTime -> IO (Maybe SessionId)     -- | Destroy a session     destroySession :: b -> SessionId -> IO ()     -- | Request a 'PasswordResetToken' for a given user, valid for 'NominalDiffTime'
users.cabal view
@@ -1,5 +1,5 @@ name:                users-version:             0.3.0.0+version:             0.4.0.0 synopsis:            A library simplifying user management for web applications description:         Scrap the boilerplate for managing user accounts in web applications                      .@@ -18,6 +18,7 @@                      Current Backends:                      .                      * <http://hackage.haskell.org/package/users-postgresql-simple PostgreSQL-Simple Backend>+                     * <http://hackage.haskell.org/package/users-persistent Persistent Backend>                      . homepage:            https://github.com/agrafix/users bug-reports:         https://github.com/agrafix/users/issues