Skip to content

Commit

Permalink
JSON serialisation for PKCRO
Browse files Browse the repository at this point in the history
  • Loading branch information
sumo committed Oct 24, 2020
1 parent c710c15 commit d10b744
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Web/WebAuthn/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ data PublicKeyCredentialDescriptor = PublicKeyCredentialDescriptor {
} deriving (Eq, Show, Generic)

instance ToJSON PublicKeyCredentialDescriptor where
toEncoding = genericToEncoding defaultOptions { omitNothingFields = True}
toEncoding = genericToEncoding defaultOptions { omitNothingFields = True, fieldLabelModifier = mapTipe}

mapTipe :: String -> String
mapTipe str = if str == "tipe" then "type" else str

data PublicKeyCredentialRequestOptions = PublicKeyCredentialRequestOptions {
challenge :: Base64ByteString
Expand Down

0 comments on commit d10b744

Please sign in to comment.