diff --git a/src/Foundation/Authorization.hs b/src/Foundation/Authorization.hs index 665cc5978..c1c660ed7 100644 --- a/src/Foundation/Authorization.hs +++ b/src/Foundation/Authorization.hs @@ -60,8 +60,8 @@ import Data.Aeson.Lens hiding (_Value, key) import qualified Data.Binary as Binary -import GHC.TypeLits (TypeError) -import qualified GHC.TypeLits as TypeError (ErrorMessage(..)) +--import GHC.TypeLits (TypeError) +--import qualified GHC.TypeLits as TypeError (ErrorMessage(..)) -- import Utils.VolatileClusterSettings @@ -108,12 +108,12 @@ class (MonadHandler m, HandlerSite m ~ UniWorX, BearerAuthSite UniWorX, MonadUnl apRunDB :: forall a. ReaderT SqlReadBackend (HandlerFor UniWorX) a -> m a -type family DisabledMonadAPInstance t err :: Constraint where - DisabledMonadAPInstance t err - = TypeError ( 'TypeError.Text "Used dangerous MonadAP instance for: " 'TypeError.:<>: 'TypeError.ShowType t - 'TypeError.:$$: 'TypeError.Text "This instance is currently disabled via TypeError because: " 'TypeError.:<>: err - 'TypeError.:$$: 'TypeError.Text "Please consider removing the usage triggering this error message before re-enabling or removing the instance." - ) +--type family DisabledMonadAPInstance t err :: Constraint where +-- DisabledMonadAPInstance t err +-- = TypeError ( 'TypeError.Text "Used dangerous MonadAP instance for: " 'TypeError.:<>: 'TypeError.ShowType t +-- 'TypeError.:$$: 'TypeError.Text "This instance is currently disabled via TypeError because: " 'TypeError.:<>: err +-- 'TypeError.:$$: 'TypeError.Text "Please consider removing the usage triggering this error message before re-enabling or removing the instance." +-- ) instance ( BearerAuthSite UniWorX -- , DisabledMonadAPInstance (HandlerFor UniWorX) ('TypeError.Text "It causes too many database connections") diff --git a/src/Foundation/Yesod/Auth.hs b/src/Foundation/Yesod/Auth.hs index efabadc80..9dab2a36c 100644 --- a/src/Foundation/Yesod/Auth.hs +++ b/src/Foundation/Yesod/Auth.hs @@ -53,6 +53,7 @@ import qualified Data.Map as Map authenticate :: ( MonadHandler m, HandlerSite m ~ UniWorX , YesodPersist UniWorX, BackendCompatible SqlBackend (YesodPersistBackend UniWorX) , YesodAuth UniWorX, UserId ~ AuthId UniWorX + , RenderMessage UniWorX CampusUserConversionException ) => Creds UniWorX -> m (AuthenticationResult UniWorX) authenticate creds@Creds{..} = liftHandler . runDB . withReaderT projectBackend $ do