Skip to content

Commit

Permalink
Merge pull request #1775 from bakaphp/hotfix-middleware-response
Browse files Browse the repository at this point in the history
fix: middleware response
  • Loading branch information
kaioken authored Aug 2, 2024
2 parents d5509fa + 2ea5596 commit 2551d4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Http/Middleware/KanvasAppKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function handleCompanyBranch(Request $request): void
app()->scoped(CompaniesBranches::class, fn () => $companyBranch);
} catch (Throwable $e) {
response()->json(['message' => 'No Company Branch configured with this key: ' . $companyBranchKey], 500)->send();
exit;
return ;
}
}
}
Expand All @@ -75,15 +75,15 @@ private function handleAppKey(Request $request): void

if ($kanvasAppKey->hasExpired()) {
response()->json(['message' => 'App Key has expired'], 500)->send();
exit;
return ;
}

$this->scopeAppKeyAndApp($kanvasAppKey, $kanvasApp);
$this->setUserIfNoBearerToken($request, $kanvasAppKey);
$this->updateLastUsedDate($kanvasAppKey);
} catch (Throwable $e) {
response()->json(['message' => 'No App Key configured with this key: ' . $appKey], 500)->send();
exit;
return ;
}
}
}
Expand Down

0 comments on commit 2551d4b

Please sign in to comment.