Skip to content

Commit f05b394

Browse files
authored
Merge pull request #720 from mschristiansen/master
Add HasLink instance for AuthProtect.
2 parents b0dbd79 + 6dd473d commit f05b394

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

servant/src/Servant/Utils/Links.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ import Servant.API.Verbs ( Verb )
112112
import Servant.API.Sub ( type (:>) )
113113
import Servant.API.Raw ( Raw )
114114
import Servant.API.TypeLevel
115+
import Servant.API.Experimental.Auth ( AuthProtect )
115116

116117
-- | A safe link datatype.
117118
-- The only way of constructing a 'Link' is using 'safeLink', which means any
@@ -259,3 +260,8 @@ instance HasLink (Verb m s ct a) where
259260
instance HasLink Raw where
260261
type MkLink Raw = Link
261262
toLink _ = id
263+
264+
-- AuthProtext instances
265+
instance HasLink sub => HasLink (AuthProtect tag :> sub) where
266+
type MkLink (AuthProtect tag :> sub) = MkLink sub
267+
toLink _ = toLink (Proxy :: Proxy sub)

0 commit comments

Comments
 (0)