From f90d752a47d677035d147b650636f8103132ba6f Mon Sep 17 00:00:00 2001 From: adambrangenberg Date: Wed, 24 Dec 2025 09:24:44 +0100 Subject: Add actual access tokens through JWT --- src/Model/Authentication.hs | 12 ------------ src/Model/AuthenticationHolder.hs | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 12 deletions(-) delete mode 100644 src/Model/Authentication.hs create mode 100644 src/Model/AuthenticationHolder.hs (limited to 'src/Model') 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 -- cgit v1.2.3