aboutsummaryrefslogtreecommitdiff
path: root/src/Auth.hs
diff options
context:
space:
mode:
authorLia Lenckowski <lialenck@protonmail.com>2023-08-17 19:26:17 +0200
committerLia Lenckowski <lialenck@protonmail.com>2023-08-17 19:26:17 +0200
commitb490f802a83382ad1a255cfef47724a0e7a9789b (patch)
treeb1b7f9dad6bb0884094deb9ecd813d2c9ee76d7f /src/Auth.hs
parent4fd80f9e24f561bd22f907621dd8901e653f1d25 (diff)
downloadfastbangs-b490f802a83382ad1a255cfef47724a0e7a9789b.tar
fastbangs-b490f802a83382ad1a255cfef47724a0e7a9789b.tar.bz2
fastbangs-b490f802a83382ad1a255cfef47724a0e7a9789b.tar.zst
error handling for login; partial adminpanel infrastructure
Diffstat (limited to 'src/Auth.hs')
-rw-r--r--src/Auth.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Auth.hs b/src/Auth.hs
index 397dd75..df97e8b 100644
--- a/src/Auth.hs
+++ b/src/Auth.hs
@@ -14,7 +14,7 @@ import Yesod
ensureAuth :: MonadHandler m => m ()
ensureAuth = lookupBasicAuth >>= \case
Nothing -> notAuthenticated
- Just (user, pw) -> unless (hashSha512 pw == hardcodedPw && user == "bleb") notAuthenticated
+ Just (user, pw) -> unless (hashSha512 pw == hardcodedPw && user == "bleb") $ permissionDenied "Wrong username/password"
where hashSha512 pw = convertToBase Base64 $ (hash $ encodeUtf8 pw :: Digest SHA512)
hardcodedPw :: ByteString
hardcodedPw = "l2gTDo5UCimSIQcdK4IrAvJtCIE7KPB7IyS5N7EN4ic78/1mI+8pikPTQTn06+W1XTOk39TgqGEX5KfpAQVm4w=="