diff options
| author | adambrangenberg <adabran06@gmail.com> | 2025-12-24 09:24:44 +0100 |
|---|---|---|
| committer | adambrangenberg <adabran06@gmail.com> | 2025-12-24 09:24:44 +0100 |
| commit | f90d752a47d677035d147b650636f8103132ba6f (patch) | |
| tree | 5d6ae46de0cec142d77c567f6ee2e0e567356ad3 /src/Model | |
| parent | 4da55d6434f6077f35466c9c0dfe3c29ee33f984 (diff) | |
Add actual access tokens through JWT
Diffstat (limited to 'src/Model')
| -rw-r--r-- | src/Model/Authentication.hs | 12 | ||||
| -rw-r--r-- | src/Model/AuthenticationHolder.hs | 23 |
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 |