Skip to content

Commit

Permalink
hlint
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaymankar committed Jun 26, 2024
1 parent cebd587 commit baf9c13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ resetPasswordImpl ident code pw = do
verify (k, c) = do
now <- Now.get
passwordResetData <- codeSelect k
res <- case passwordResetData of
case passwordResetData of
Just (PRQueryData codeInDB u _ (Just t)) | c == codeInDB && t >= now -> pure (Just u)
Just (PRQueryData codeInDB u (Just n) (Just t)) | n > 1 && t > now -> do
-- If we only update retries, there is a chance that this races with
Expand All @@ -215,4 +215,3 @@ resetPasswordImpl ident code pw = do
pure Nothing
Just PRQueryData {} -> codeDelete k $> Nothing
Nothing -> pure Nothing
pure res
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ runErrorUnsafe action = do
Right x -> pure x

catchExpectedError :: (Member (Error e) r) => Sem r a -> Sem r (Maybe e)
catchExpectedError action = (const Nothing <$> action) `catch` (pure . Just)
catchExpectedError action = (Nothing <$ action) `catch` (pure . Just)
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ inMemoryPasswordResetCodeStore =
pure . PasswordResetCode . encodeBase64Url $ "email-code"
GeneratePhoneCode -> (error "deprecated")
CodeSelect resetKey -> do
gets $ \codes ->
mapPRQueryData (Just . runIdentity)
<$> Map.lookup resetKey codes
gets $
fmap (mapPRQueryData (Just . runIdentity))
. Map.lookup resetKey
CodeInsert resetKey queryData _ttl -> do
modify $ Map.insert resetKey queryData
CodeDelete resetKey -> do
Expand Down

0 comments on commit baf9c13

Please sign in to comment.