aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Authentication.hs12
-rw-r--r--src/Model/AuthenticationHolder.hs23
2 files changed, 23 insertions, 12 deletions
diff --git a/src/Model/Authentication.hs b/src/Model/Authentication.hs
deleted file mode 100644
index be1337a..0000000
--- a/src/Model/Authentication.hs
+++ /dev/null
@@ -1,12 +0,0 @@
-{-# LANGUAGE DeriveGeneric #-}
-
-module Model.Authentication (AuthenticationResponse (..)) where
-
-import GHC.Generics
-import Data.Text (Text)
-
-----------------------------------------------------------------------------------------------------
-data AuthenticationResponse = AuthenticationResponse -- delete?
- { userId :: Text
- }
- deriving (Show, Eq, Generic)
diff --git a/src/Model/AuthenticationHolder.hs b/src/Model/AuthenticationHolder.hs
new file mode 100644
index 0000000..d3b53de
--- /dev/null
+++ b/src/Model/AuthenticationHolder.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+
+module Model.AuthenticationHolder (AuthenticationHolder (..), server_password) where
+
+import Data.Aeson
+import GHC.Generics
+import Data.Text (Text)
+import Data.ByteString
+
+----------------------------------------------------------------------------------------------------
+data AuthenticationHolder = AuthenticationHolder
+ { username :: Text
+ , device :: Text
+ , expire :: Maybe Int
+ }
+ deriving (Show, Eq, Generic)
+
+instance FromJSON AuthenticationHolder
+instance ToJSON AuthenticationHolder
+
+server_password :: ByteString
+server_password = "jamaa_dev" \ No newline at end of file