Skip to content

Commit

Permalink
fix undefined usage
Browse files Browse the repository at this point in the history
  • Loading branch information
battermann committed Jun 21, 2024
1 parent e1d4ccf commit 3a727ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions libs/wire-subsystems/src/Wire/UserKeyStore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ forEmailKey k f = foldKey (fmap Just . f) (const (pure Nothing)) k
forPhoneKey :: (Applicative f) => UserKey -> (Phone -> f a) -> f (Maybe a)
forPhoneKey k f = foldKey (const (pure Nothing)) (fmap Just . f) k

fromEither :: Either Email Phone -> UserKey
fromEither = either userEmailKey userPhoneKey

data UserKeyStore m a where
LookupKey :: UserKey -> UserKeyStore m (Maybe UserId)
InsertKey :: UserId -> UserKey -> UserKeyStore m ()
Expand Down
3 changes: 1 addition & 2 deletions services/brig/src/Brig/API/Public.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,7 @@ beginPasswordReset ::
Handler r ()
beginPasswordReset (Public.NewPasswordReset target) = do
checkAllowlist target
let key = undefined target
(u, pair) <- lift (liftSem $ createPasswordResetCode key) !>> pwResetError
(u, pair) <- lift (liftSem $ createPasswordResetCode (fromEither target)) !>> pwResetError
loc <- lift $ wrapClient $ API.lookupLocale u
lift $ case target of
Left email -> sendPasswordResetMail email pair loc
Expand Down

0 comments on commit 3a727ea

Please sign in to comment.