Small Adjustments

This commit is contained in:
Your Name 2021-07-29 01:26:23 +02:00
parent df0f8f36f7
commit 63b8173399
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
<?php namespace GermanAirlinesVa\Graphql\Classes;
use Closure;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
class Authentication
{
@ -13,11 +14,11 @@ class Authentication
*/
public function handle($request, Closure $next)
{
if ($request->input('gql_session') === 'SUPER_SECRET_TOKEN') {
return "false";
if ($request->header('Gql-Session') === 'SUPER_SECRET_KEY_HEADER') {
return "";
}
else {
return "true";
throw new AccessDeniedHttpException;
}
return $next($request);

View File

@ -23,6 +23,7 @@ extend type Mutation {
}
type Aircraft {
id: ID!
aircraft_type_id: ID!
home_airport_id: ID!
name: String!