aboutsummaryrefslogtreecommitdiff
path: root/src/Endpoints/LoginEndpoint.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Endpoints/LoginEndpoint.hs')
-rw-r--r--src/Endpoints/LoginEndpoint.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Endpoints/LoginEndpoint.hs b/src/Endpoints/LoginEndpoint.hs
index ad4a514..cca10d4 100644
--- a/src/Endpoints/LoginEndpoint.hs
+++ b/src/Endpoints/LoginEndpoint.hs
@@ -40,9 +40,9 @@ handleLoginPost :: LoginRequest -> Handler LoginResponse
handleLoginPost req = do
let
input_password = password req
- username = T.unpack $ user $ identifier req
+ username = user $ identifier req
- maybe_user <- liftIO $ runDb $ getBy $ UniqueName $ T.pack username
+ maybe_user <- liftIO $ runDb $ getBy $ UniqueName $ username
case maybe_user of
Just (Entity _ db_user) -> do
@@ -50,8 +50,8 @@ handleLoginPost req = do
Right hashedPasswordBytes ->
if validatePassword hashedPasswordBytes (T.encodeUtf8 input_password)
then return $ LoginResponse
- { user_id = T.pack ("@" ++ username ++ ":localhost")
- , access_token = T.pack ("dummy" ++ username)
+ { user_id = T.concat ["@", username, ":localhost"]
+ , access_token = T.concat ["dummy", username]
, home_server = "localhost"
, device_id = "DUMMY"
}