Browse Source

fix(core): AuthGuard correctly handles subscriptions

Add Subscription to parent type resolver action
fix problem when trying to authenticate a graphql subscription

Co-authored-by: danieldflrss <danieldflrss@gmail.com>
Christian Stocker 3 years ago
parent
commit
96d10b3ae6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core/src/api/middleware/auth-guard.ts

+ 1 - 1
packages/core/src/api/middleware/auth-guard.ts

@@ -175,6 +175,6 @@ export class AuthGuard implements CanActivate {
             return false;
         }
         const parentType = info?.parentType?.name;
-        return parentType !== 'Query' && parentType !== 'Mutation';
+        return parentType !== 'Query' && parentType !== 'Mutation' && parentType !== 'Subscription';
     }
 }