Skip to content

Commit aaadfbe

Browse files
Merge pull request #71 from IFRCGo/WN-379
Only enforce org check for v2 API
2 parents 418cf42 + 4451c88 commit aaadfbe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/Http/Middleware/ApiAuthMiddleware.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public function handle($request, Closure $next)
4444
return response()->json(['error' => 'Application is not allowed to access this API version'], 403);
4545
}
4646

47-
$canAccessOrganisation = $this->canAccessOrganisation($request->path(), (array) $application->rules);
47+
$canAccessOrganisation = true;
48+
if (strpos($request->path(), 'v2/') === 0) {
49+
$canAccessOrganisation = $this->canAccessOrganisation($request->path(), (array) $application->rules);
50+
}
4851

4952
if (!$canAccessOrganisation) {
5053
return response()->json(['error' => 'Application is not allowed to access this organisation'], 403);

0 commit comments

Comments
 (0)