diff --git a/src/Auth/LDAP.hs b/src/Auth/LDAP.hs index b7a03d4a9..9064a83f4 100644 --- a/src/Auth/LDAP.hs +++ b/src/Auth/LDAP.hs @@ -263,6 +263,7 @@ campusForm = do <*> areq passwordField (fslpI MsgCampusPassword (mr MsgCampusPasswordPlaceholder) & addAttr "autocomplete" "current-password") Nothing +-- TODO: reintroduce Failover ldapLogin :: forall site. ( YesodAuth site , RenderMessage site CampusMessage @@ -271,10 +272,10 @@ ldapLogin :: forall site. , RenderMessage site ADInvalidCredentials , Button site ButtonSubmit ) - => (LdapConf, LdapPool) -- TODO: reintroduce Failover - -> FailoverMode + => LdapConf + -> LdapPool -> AuthPlugin site -ldapLogin pool mode = AuthPlugin{..} +ldapLogin conf@LdapConf{..} pool = AuthPlugin{..} where apName :: Text apName = apLdap @@ -285,7 +286,7 @@ ldapLogin pool mode = AuthPlugin{..} tp <- getRouteToParent resp <- formResultMaybe loginRes $ \CampusLogin{ campusIdent = CI.original -> campusIdent, ..} -> Just <$> do - ldapResult <- withLdap _2 pool mode $ \(conf@LdapConf{..}, ldap) -> liftIO $ do + ldapResult <- withLdap pool $ \ldap -> liftIO $ do Ldap.bind ldap ldapDn ldapPassword searchResults <- findUser conf ldap campusIdent [ldapUserPrincipalName] case searchResults of diff --git a/src/Foundation/Instances.hs b/src/Foundation/Instances.hs index 8ab8d9beb..df14e7de3 100644 --- a/src/Foundation/Instances.hs +++ b/src/Foundation/Instances.hs @@ -142,7 +142,7 @@ instance YesodAuth UniWorX where authenticate = UniWorX.authenticate authPlugins UniWorX{ appSettings' = AppSettings{..}, appLdapPool, appAuthPlugins } = appAuthPlugins ++ catMaybes - [ flip campusLogin campusUserFailoverMode <$> appLdapPool + [ uncurry ldapLogin <$> appLdapPool , Just . hashLogin $ pwHashAlgorithm appAuthPWHash , dummyLogin <$ guard appAuthDummyLogin ]