diff --git a/servant-mock/src/Servant/Mock.hs b/servant-mock/src/Servant/Mock.hs index 5489d33e..a168fea8 100644 --- a/servant-mock/src/Servant/Mock.hs +++ b/servant-mock/src/Servant/Mock.hs @@ -154,8 +154,10 @@ instance (KnownSymbol s, HasMock rest) => HasMock (MatrixFlag s :> rest) where instance (KnownSymbol h, FromText a, HasMock rest) => HasMock (Header h a :> rest) where mock _ = \_ -> mock (Proxy :: Proxy rest) -instance (HasMock rest, AuthData authdata, Arbitrary usr) => HasMock (AuthProtect authdata (usr :: *) 'Lax :> rest) where - mock _ = laxProtect (\_ -> do { a <- generate arbitrary; return (Just a)}) (\_ -> mock (Proxy :: Proxy rest)) +instance (HasMock rest, AuthData authdata, Arbitrary usr) + => HasMock (AuthProtect authdata (usr :: *) 'Lax :> rest) where + mock _ = laxProtect (\_ -> do { a <- generate arbitrary; return (Just a)}) + (\_ -> mock (Proxy :: Proxy rest)) instance (HasMock rest, Arbitrary usr, KnownSymbol realm) => HasMock (AuthProtect (BasicAuth realm) (usr :: *) 'Strict :> rest) where