Fix missing risk challenge response
This commit is contained in:
@@ -53,6 +53,7 @@ const (
|
||||
imReasonUnsupportedMedia = "UNSUPPORTED_MEDIA_TYPE"
|
||||
imReasonFileUnavailable = "FILE_UNAVAILABLE"
|
||||
imReasonRateLimited = "RATE_LIMITED"
|
||||
imReasonResourceNotFound = "RESOURCE_NOT_FOUND"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -1257,6 +1258,10 @@ func serveIMRiskChallengeConfirm(wrt http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
challenge, err := store.Safety.ConfirmRiskChallenge(principal.TenantID, principal.Uid, challengeID, decision, tokenID, time.Now().UTC().Round(time.Millisecond))
|
||||
if err != nil {
|
||||
if errors.Is(err, types.ErrNotFound) {
|
||||
writeIMError(wrt, req, http.StatusNotFound, 30004, imReasonResourceNotFound, "risk challenge not found", nil)
|
||||
return
|
||||
}
|
||||
writeIMRelationError(wrt, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user