Compare commits

...

2 Commits

Author SHA1 Message Date
Your Name
2106f15d7f Naming adjusted for consistency 2021-07-29 01:30:05 +02:00
Your Name
63b8173399 Small Adjustments 2021-07-29 01:26:23 +02:00
2 changed files with 6 additions and 4 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

@ -8,7 +8,7 @@ extend type Query {
}
extend type Subscription {
aircraftAdded: Aircraft @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\Aircraft")
aircraftAdded: Aircraft @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\AircraftAdded")
}
extend type Mutation {
@ -23,6 +23,7 @@ extend type Mutation {
}
type Aircraft {
id: ID!
aircraft_type_id: ID!
home_airport_id: ID!
name: String!