File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
services/brig/src/Brig/Provider Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change
1
+ The bot API will be blocked if the 2nd factor authentication team feature is enabled.
Original file line number Diff line number Diff line change @@ -954,7 +954,6 @@ botGetSelfH bot = do
954
954
955
955
botGetSelf :: BotId -> (Handler r ) Public. UserProfile
956
956
botGetSelf bot = do
957
- checkAllowed (Just (botUserId bot))
958
957
p <- lift $ wrapClient $ User. lookupUser NoPendingInvitations (botUserId bot)
959
958
maybe (throwErrorDescriptionType @ UserNotFound ) (return . (`Public.publicProfile` UserLegalHoldNoConsent )) p
960
959
@@ -1043,16 +1042,9 @@ botDeleteSelf bid cid = do
1043
1042
-- Utilities
1044
1043
1045
1044
checkAllowed :: Maybe UserId -> (Handler r ) ()
1046
- checkAllowed = \ case
1047
- Just userId ->
1048
- whenM (isPasswordChallengeEnabled (Just userId)) $ throwStd accessDenied
1049
- Nothing ->
1050
- whenM (isPasswordChallengeEnabled Nothing ) $ throwStd accessDenied
1051
-
1052
- isPasswordChallengeEnabled :: Maybe UserId -> (Handler r ) Bool
1053
- isPasswordChallengeEnabled mbUserId = do
1054
- status <- lift $ RPC. getTeamFeatureStatusSndFactorPasswordChallenge mbUserId
1055
- pure $ Feature. tfwoStatus status == Feature. TeamFeatureEnabled
1045
+ checkAllowed mbUserId = do
1046
+ enabled <- lift $ (==) Feature. TeamFeatureEnabled . Feature. tfwoStatus <$> RPC. getTeamFeatureStatusSndFactorPasswordChallenge mbUserId
1047
+ when enabled $ throwStd accessDenied
1056
1048
1057
1049
minRsaKeySize :: Int
1058
1050
minRsaKeySize = 256 -- Bytes (= 2048 bits)
You can’t perform that action at this time.
0 commit comments