From b490f802a83382ad1a255cfef47724a0e7a9789b Mon Sep 17 00:00:00 2001 From: Lia Lenckowski Date: Thu, 17 Aug 2023 19:26:17 +0200 Subject: error handling for login; partial adminpanel infrastructure --- src/Auth.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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==" -- cgit v1.2.3-70-g09d2