File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,11 @@ public function boot()
26
26
if (config ('lighthouse-graphql-passport.migrations ' )) {
27
27
$ this ->loadMigrationsFrom (__DIR__ .'/../../migrations ' );
28
28
}
29
- app (AuthorizationServer::class)->enableGrantType ($ this ->makeCustomRequestGrant (), Passport::tokensExpireIn ());
30
- app (AuthorizationServer::class)->enableGrantType ($ this ->makeLoggedInRequestGrant (), Passport::tokensExpireIn ());
31
29
}
32
30
33
31
public function register ()
34
32
{
33
+ $ this ->extendAuthorizationServer ();
35
34
$ this ->registerConfig ();
36
35
37
36
app ('events ' )->listen (
@@ -102,4 +101,24 @@ protected function makeLoggedInRequestGrant()
102
101
103
102
return $ grant ;
104
103
}
104
+
105
+ /**
106
+ * Register the Grants.
107
+ *
108
+ * @return void
109
+ */
110
+ protected function extendAuthorizationServer ()
111
+ {
112
+ $ this ->app ->extend (AuthorizationServer::class, function ($ server ) {
113
+ return tap ($ server , function ($ server ) {
114
+ $ server ->enableGrantType (
115
+ $ this ->makeLoggedInRequestGrant (), Passport::tokensExpireIn ()
116
+ );
117
+
118
+ $ server ->enableGrantType (
119
+ $ this ->makeCustomRequestGrant (), Passport::tokensExpireIn ()
120
+ );
121
+ });
122
+ });
123
+ }
105
124
}
You can’t perform that action at this time.
0 commit comments