mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
setup
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class IsAppAccessAuthorized
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
if (isset(getallheaders()['App-Key']) && (string) getallheaders()['App-Key'] === config('constants.app_key')) {
|
||||
return $next($request);
|
||||
}
|
||||
else {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'error' => config('error_code.invalid_app_key')
|
||||
], 422);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user