diff options
| author | adambrangenberg <adabran06@gmail.com> | 2025-12-24 05:09:10 +0100 |
|---|---|---|
| committer | adambrangenberg <adabran06@gmail.com> | 2025-12-24 05:09:10 +0100 |
| commit | 34cba7d0f9faffe7b97692ccc6b3402fced63cbb (patch) | |
| tree | a638fb60eb4899a427f21f13ab2d497bf5fd3e6e /src/Endpoints/LoginEndpoint.hs | |
| parent | a0886694f73fc382d78da79ab8bfb27475757bab (diff) | |
Refactor
Diffstat (limited to 'src/Endpoints/LoginEndpoint.hs')
| -rw-r--r-- | src/Endpoints/LoginEndpoint.hs | 8 |
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" } |