Skip to content

Commit

Permalink
Fix issues found during operation claim integration into mobile token (
Browse files Browse the repository at this point in the history
  • Loading branch information
romanstrobl authored Dec 6, 2023
1 parent 7529deb commit 11bc4fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/Mobile-Token-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ Claim an operation for a user.
```json
{
"requestObject": {
"id": "7e0ba60f-bf22-4ff5-b999-2733784e5eaa",
"userId": "user12345"
"id": "7e0ba60f-bf22-4ff5-b999-2733784e5eaa"
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ public Response operationReject(
*/
public Operation getOperationDetail(String operationId, String language, String userId) throws MobileTokenException, PowerAuthClientException, MobileTokenConfigurationException {
final OperationDetailResponse operationDetail = getOperationDetailInternal(operationId);
if (!userId.equals(operationDetail.getUserId())) {
// Check user ID against authenticated user, however skip the check in case operation is not claimed yet
if (operationDetail.getUserId() != null && !userId.equals(operationDetail.getUserId())) {
logger.warn("User ID from operation does not match authenticated user ID.");
throw new MobileTokenException(ErrorCode.INVALID_REQUEST, "Invalid request");
}
Expand Down

0 comments on commit 11bc4fb

Please sign in to comment.