Compare commits
2 Commits
df0f8f36f7
...
2106f15d7f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2106f15d7f | ||
|
|
63b8173399 |
@ -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);
|
||||
|
||||
@ -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!
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user