Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
fisx committed Oct 20, 2020
1 parent 84ca176 commit fd3bbf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions services/brig/src/Brig/API/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ connError TooManyConnections {} = StdError connectionLimitReached
connError InvalidTransition {} = StdError invalidTransition
connError NotConnected {} = StdError notConnected
connError InvalidUser {} = StdError invalidUser
connError ConnectNoIdentity {} = StdError noIdentity
connError ConnectNoIdentity {} = StdError (noIdentity 0)
connError (ConnectBlacklistedUserKey k) = StdError $ foldKey (const blacklistedEmail) (const blacklistedPhone) k
connError (ConnectInvalidEmail _ _) = StdError invalidEmail
connError ConnectInvalidPhone {} = StdError invalidPhone
Expand Down Expand Up @@ -123,11 +123,11 @@ changePhoneError (PhoneExists _) = StdError userKeyExists

changePwError :: ChangePasswordError -> Error
changePwError InvalidCurrentPassword = StdError badCredentials
changePwError ChangePasswordNoIdentity = StdError noIdentity
changePwError ChangePasswordNoIdentity = StdError (noIdentity 1)
changePwError ChangePasswordMustDiffer = StdError changePasswordMustDiffer

changeHandleError :: ChangeHandleError -> Error
changeHandleError ChangeHandleNoIdentity = StdError noIdentity
changeHandleError ChangeHandleNoIdentity = StdError (noIdentity 2)
changeHandleError ChangeHandleExists = StdError handleExists
changeHandleError ChangeHandleInvalid = StdError invalidHandle

Expand Down Expand Up @@ -179,7 +179,7 @@ clientError ClientLegalHoldCannotBeAdded = StdError can'tAddLegalHoldClient
idtError :: RemoveIdentityError -> Error
idtError LastIdentity = StdError lastIdentity
idtError NoPassword = StdError noPassword
idtError NoIdentity = StdError noIdentity
idtError NoIdentity = StdError (noIdentity 3)

propDataError :: PropertiesDataError -> Error
propDataError TooManyProperties = StdError tooManyProperties
Expand Down Expand Up @@ -241,8 +241,8 @@ invalidTransition = Wai.Error status403 "bad-conn-update" "Invalid status transi
notConnected :: Wai.Error
notConnected = Wai.Error status403 "no-connection" "No connection exists between users."

noIdentity :: Wai.Error
noIdentity = Wai.Error status403 "no-identity" "The user has no verified identity (email or phone number)."
noIdentity :: Int -> Wai.Error
noIdentity i = Wai.Error status403 "no-identity" ("The user has no verified identity (email or phone number)." <> cs (show i))

noEmail :: Wai.Error
noEmail = Wai.Error status403 "no-email" "This operation requires the user to have a verified email address."
Expand Down
4 changes: 2 additions & 2 deletions services/brig/src/Brig/API/Public.hs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ sitemap o = do
Doc.description "JSON body"
Doc.response 200 "Password changed." Doc.end
Doc.errorResponse badCredentials
Doc.errorResponse noIdentity
Doc.errorResponse (noIdentity 11)

put "/self/locale" (continue changeLocaleH) $
zauthUserId
Expand Down Expand Up @@ -451,7 +451,7 @@ sitemap o = do
Doc.response 201 "The connection was created." Doc.end
Doc.errorResponse connectionLimitReached
Doc.errorResponse invalidUser
Doc.errorResponse noIdentity
Doc.errorResponse (noIdentity 12)

get "/connections" (continue listConnectionsH) $
accept "application" "json"
Expand Down

0 comments on commit fd3bbf8

Please sign in to comment.