clckwrks 0.23.10 → 0.23.11
raw patch · 3 files changed
+19/−7 lines, 3 filesdep ~happstack-authenticate
Dependency ranges changed: happstack-authenticate
Files
- Clckwrks/Authenticate/Plugin.hs +15/−3
- Clckwrks/ProfileData/Types.hs +2/−2
- clckwrks.cabal +2/−2
Clckwrks/Authenticate/Plugin.hs view
@@ -23,8 +23,9 @@ import qualified Data.Set as Set import qualified Data.Text.Lazy as TL import Data.UserId (UserId)-import Happstack.Authenticate.Core (AuthenticateState, getToken, tokenUser, userId)+import Happstack.Authenticate.Core (AuthenticateState, AuthenticateConfig(..), getToken, tokenUser, userId, usernamePolicy) import Happstack.Authenticate.Route (initAuthentication)+import Happstack.Authenticate.Password.Core (PasswordConfig(..)) import Happstack.Authenticate.Password.Route (initPassword) import Happstack.Authenticate.OpenId.Route (initOpenId) import Happstack.Server@@ -74,8 +75,19 @@ baseUri = case calcTLSBaseURI cc of Nothing -> calcBaseURI cc (Just b) -> b- (authCleanup, routeAuthenticate, authenticateState) <- initAuthentication (Just basePath) (\uid -> Acid.query (acidProfileData acid) (HasRole uid (Set.singleton Administrator)))- [ initPassword (baseUri <> authShowFn ResetPassword [] <> "/#") (Text.pack $ clckHostname cc)+ let authenticateConfig = AuthenticateConfig {+ _isAuthAdmin = \uid -> Acid.query (acidProfileData acid) (HasRole uid (Set.singleton Administrator))+ , _usernameAcceptable = usernamePolicy+ , _requireEmail = True+ }+ passwordConfig = PasswordConfig {+ _resetLink = baseUri <> authShowFn ResetPassword [] <> "/#"+ , _domain = Text.pack $ clckHostname cc+ , _passwordAcceptable = const Nothing+ }++ (authCleanup, routeAuthenticate, authenticateState) <- initAuthentication (Just basePath) authenticateConfig+ [ initPassword passwordConfig , initOpenId ] addHandler plugins (pluginName authenticatePlugin) (authenticateHandler routeAuthenticate authShowFn)
Clckwrks/ProfileData/Types.hs view
@@ -39,8 +39,8 @@ data ProfileData = ProfileData { dataFor :: UserId- , username :: Text- , email :: Maybe Text+ , username :: Text -- ^ now comes from happstack-authenticate+ , email :: Maybe Text -- ^ now comes from happstack-authenticate , roles :: Set Role , attributes :: Map Text Text }
clckwrks.cabal view
@@ -1,5 +1,5 @@ Name: clckwrks-Version: 0.23.10+Version: 0.23.11 Synopsis: A secure, reliable content management system (CMS) and blogging platform Description: clckwrks (pronounced, clockworks) aims to compete directly with popular PHP-based blogging and CMS@@ -99,7 +99,7 @@ containers >= 0.4 && < 0.6, directory >= 1.1 && < 1.3, filepath >= 1.2 && < 1.5,- happstack-authenticate >= 2.2 && < 2.3,+ happstack-authenticate >= 2.3 && < 2.4, happstack-hsp == 7.3.*, happstack-jmacro >= 7.0 && < 7.1, happstack-server >= 7.0 && < 7.5,