
module Zero.Account.Client
  (
    Credentials(..)
  ) where

import           GHC.Generics (Generic)
import           Data.Text (Text)
import           Data.Aeson

------------------------------------------------------------------------------
-- Types
------------------------------------------------------------------------------

data Credentials = Credentials
  { c_email     :: Text
  , c_salt      :: Text
  , c_pass      :: Text
  , c_unwrapKey :: Text
  } deriving (Show, Generic)

instance ToJSON Credentials where
  toJSON (Credentials email salt pass unwrapKey) =
    object [
      "email" .= email
    , "salt" .= salt
    , "pass" .= pass
    , "unwrapKey" .= unwrapKey
    ]

