about summary refs log tree commit diff
path: root/src/Types.hs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-07-28T20·33+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-07-28T20·33+0100
commitcf6c8799ab86278c827d4236a7a89163c61c29b9 (patch)
treefe34a5b41f63a44ff961af2a85a27e625220291d /src/Types.hs
parentf051b0be0bc360c949b3b1913f13c4856ae317ca (diff)
Restrict users from multiple failed login attempts
I'm not resetting the failed LoginAttempt count, which is a low priority for
now, but necessary eventually.
Diffstat (limited to 'src/Types.hs')
-rw-r--r--src/Types.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Types.hs b/src/Types.hs
index 25f7d8996a36..d33ea6870f13 100644
--- a/src/Types.hs
+++ b/src/Types.hs
@@ -374,3 +374,11 @@ instance FromRow StoredSession where
   fromRow = StoredSession <$> field
                           <*> field
                           <*> field
+
+data LoginAttempt = LoginAttempt
+  { loginAttemptUsername :: Username
+  , loginAttemptNumAttempts :: Integer
+  } deriving (Eq, Show)
+
+instance FromRow LoginAttempt where
+  fromRow = LoginAttempt <$> field <*> field