Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 79 lines (69 sloc) 1.64 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE OverloadedStrings #-}

------------------------------------------------------------------------------
-- |
--
-- This module contains all the central authentication functionality.
--
-- It exports a number of high-level functions to be used directly in your
-- application handlers.
--
-- We also export a number of mid-level functions that should be helpful when
-- you are integrating with another way of confirming the authentication of
-- login requests.
--

module Snap.Snaplet.Auth
  (
  -- * Higher Level Handler Functions
    createUser
  , usernameExists
  , saveUser
  , destroyUser
  , loginByUsername
  , loginByRememberToken
  , forceLogin
  , logout
  , currentUser
  , isLoggedIn

  -- * Lower Level Functions
  , markAuthSuccess
  , markAuthFail
  , checkPasswordAndLogin

  -- * Types
  , AuthManager(..)
  , IAuthBackend(..)
  , AuthSettings(..)
  , defAuthSettings
  , AuthUser(..)
  , defAuthUser
  , UserId(..)
  , Password(..)
  , AuthFailure(..)
  , BackendError(..)
  , Role(..)

  -- * Other Utilities
  , authSettingsFromConfig
  , withBackend
  , encryptPassword
  , checkPassword
  , authenticatePassword
  , setPassword
  , encrypt
  , verify

  -- * Handlers
  , registerUser
  , loginUser
  , logoutUser
  , requireUser

  -- * Splice helpers
  , addAuthSplices
  , ifLoggedIn
  , ifLoggedOut
  , loggedInUser
  )
  where

------------------------------------------------------------------------------
import Snap.Snaplet.Auth.AuthManager
import Snap.Snaplet.Auth.Handlers
import Snap.Snaplet.Auth.SpliceHelpers
import Snap.Snaplet.Auth.Types

Something went wrong with that request. Please try again.