Skip to content

Instantly share code, notes, and snippets.

@mightybyte
Forked from adinapoli/gist:3723225
Created September 14, 2012 17:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mightybyte/3723262 to your computer and use it in GitHub Desktop.
Save mightybyte/3723262 to your computer and use it in GitHub Desktop.
createUser :: Text -- ^ Username
-> ByteString -- ^ Password
-> Handler b (AuthManager b) (Either String AuthUser)
createUser "" _ = return $ Left "Username cannot be empty"
createUser unm pwd = withBackend $ \r -> do
u <- liftIO $ buildAuthUser r unm pwd
return $ Right u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment