File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -55,17 +55,10 @@ protected function getBuilder(
55
55
($ this ->useMicroseconds ? microtime (true ) : time ())
56
56
);
57
57
58
- if ($ this ->currentRequestService ) {
59
- $ uri = $ this ->currentRequestService ->getRequest ()->getUri ();
60
- $ issuer = $ uri ->getScheme () . ':// ' . $ uri ->getHost () . ($ uri ->getPort () ? ': ' . $ uri ->getPort () : '' );
61
- } else {
62
- $ issuer = 'https:// ' . $ _SERVER ['HTTP_HOST ' ];
63
- }
64
-
65
58
return $ this ->config
66
59
->builder ()
67
60
->permittedFor ($ accessToken ->getClient ()->getIdentifier ())
68
- ->issuedBy ($ issuer )
61
+ ->issuedBy (' https:// ' . $ _SERVER [ ' HTTP_HOST ' ] )
69
62
->issuedAt ($ dateTimeImmutableObject )
70
63
->expiresAt ($ dateTimeImmutableObject ->add (new DateInterval ('PT1H ' )))
71
64
->relatedTo ($ userEntity ->getIdentifier ());
Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \Http \Request ;
6
6
use Illuminate \Support \Facades \Route ;
7
+ use Illuminate \Support \Facades \URL ;
7
8
use Laravel \Passport \Passport ;
8
9
9
10
class DiscoveryController
@@ -13,8 +14,10 @@ class DiscoveryController
13
14
*/
14
15
public function __invoke (Request $ request )
15
16
{
17
+ URL ::forceScheme ('https ' ); // for route() calls below
18
+
16
19
$ response = [
17
- 'issuer ' => url ( ' / ' ) ,
20
+ 'issuer ' => ' https:// ' . $ _SERVER [ ' HTTP_HOST ' ] ,
18
21
'authorization_endpoint ' => route ('passport.authorizations.authorize ' ),
19
22
'token_endpoint ' => route ('passport.token ' ),
20
23
'grant_types_supported ' => $ this ->getSupportedGrantTypes (),
You can’t perform that action at this time.
0 commit comments