fixing json representations
This commit is contained in:
parent
961fab0c88
commit
672d0ac474
2 changed files with 5 additions and 4 deletions
|
@ -174,7 +174,7 @@ getUserAuthInfo conn id = do
|
|||
)
|
||||
]
|
||||
head <$> mapM (\(i1, i2, i3, i4, i5, i6, i7, i8, i9) -> return $
|
||||
AuthInfo (AuthSalt i7) (fromMaybe PBKDF2 $ (toEnum <$> i9))
|
||||
AuthInfo (AuthSalt i7) (toEnum $ fromMaybe 0 i9)
|
||||
)
|
||||
users
|
||||
|
||||
|
|
|
@ -25,12 +25,13 @@ instance FromJSON AuthInfo
|
|||
|
||||
data AuthAlgorithm
|
||||
= PBKDF2
|
||||
deriving (Show, Generic, Enum)
|
||||
deriving (Show, Read, Generic, Enum)
|
||||
|
||||
instance ToJSON AuthAlgorithm where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
toJSON = toJSON . show
|
||||
|
||||
instance FromJSON AuthAlgorithm
|
||||
instance FromJSON AuthAlgorithm where
|
||||
parseJSON j = read <$> parseJSON j
|
||||
|
||||
newtype AuthSalt = AuthSalt ByteString deriving (Show)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue