Skip to content

Commit

Permalink
auth user doesn't include prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Nov 2, 2023
1 parent 0e6baaf commit 5fc29a4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ private User getAuthenticatedUserFromSignedUrl(ContainerRequestContext container
String userId = uriInfo.getQueryParameters().getFirst(SIGNED_URL_USER);
User targetUser = null;
ApiToken userApiToken = null;
if(userId.startsWith(AuthenticatedUser.IDENTIFIER_PREFIX)) {
if(!userId.startsWith(PrivateUrlUser.PREFIX)) {
targetUser = authSvc.getAuthenticatedUser(userId);
userApiToken = authSvc.findApiTokenByUser((AuthenticatedUser)targetUser);
} else if (userId.startsWith(PrivateUrlUser.PREFIX)) {
} else {
PrivateUrl privateUrl = privateUrlSvc.getPrivateUrlFromDatasetId(Long.parseLong(userId.substring(PrivateUrlUser.PREFIX.length())));
userApiToken = new ApiToken();
userApiToken.setTokenString(privateUrl.getToken());
Expand Down

0 comments on commit 5fc29a4

Please sign in to comment.