Fix faulty utils method
@@ -510,26 +510,20 @@ function getRequestForSameCredentials(priorRequests, requestCredentials) {
const requesterWebId = get(requestCredentials, "requesterWebId");
if (priorRequests && priorRequests.size > 0 && requestCredentials) {
- return priorRequests.find(request => {
- if (requestTokenFromAtomUri) {
- const obtainedFrom = getIn(request, [
+ return priorRequests.find(
+ request =>
+ requestTokenFromAtomUri
+ ? getIn(request, ["requestCredentials", "obtainedFrom", "scope"]) ===
+ scope &&
+ getIn(request, [
"requestCredentials",
"obtainedFrom",
- ]);
-
- return (
- get(obtainedFrom, "scope") === scope &&
- get(obtainedFrom, "requestTokenFromAtomUri") ===
- requestTokenFromAtomUri
- );
- } else {
- return (
- get(request, ["requestCredentials", "requesterWebId"]) ===
+ "requestTokenFromAtomUri",
+ ]) === requestTokenFromAtomUri
+ : getIn(request, ["requestCredentials", "requesterWebId"]) ===
requesterWebId
);
}
- });
- }
return undefined;
}
