Skip to content

Commit

Permalink
fix: middleware response
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioken committed Aug 2, 2024
1 parent f50240b commit 2ea5596
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 2ea5596

Please sign in to comment.