Check for key app on authorization

This commit is contained in:
Alex Renoki 2020-12-01 19:43:18 +02:00
parent f08e4f287a
commit e0d8f6ac33
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,10 @@ class Authorize
{ {
public function handle($request, $next) public function handle($request, $next)
{ {
return is_null(App::findBySecret($request->secret)) ? abort(403) : $next($request); $app = App::findByKey($request->key);
return is_null($app) || $app->secret !== $request->secret
? abort(403)
: $next($request);
} }
} }