File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed
Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 11<?php
22
3+ use DesignMyNight \Laravel \OAuth2 \Http \Controllers \RedirectImplicitGrant ;
4+
35/**
46 * Redirecting endpoint for initiating the OAuth2 Implicit Grant flow.
57 * The retrieved access token can be used to call the APIs as protected with the provided middleware.
68 *
79 * Note: this module does not provide any logic for extracting the access tokens from the url.
810 *
911 */
10- Route::get ('/redirect ' , function (Request $ request ) {
11- $ query = http_build_query ([
12- 'client_id ' => config ('authorizationserver.client_id ' ),
13- 'redirect_uri ' => config ('authorizationserver.redirect_url ' ),
14- 'response_type ' => 'token ' ,
15- 'scope ' => 'place-orders ' ,
16- ]);
17-
18- return redirect (config ('authorizationserver.authorization_url ' ) . '? ' . $ query );
19- });
12+ Route::get ('/redirect ' , RedirectImplicitGrant::class);
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace DesignMyNight \Laravel \OAuth2 \Http \Controllers ;
4+
5+ use Illuminate \Routing \Controller ;
6+
7+ class RedirectImplicitGrant extends Controller
8+ {
9+ public function __invoke ()
10+ {
11+ $ query = http_build_query ([
12+ 'client_id ' => config ('authorizationserver.client_id ' ),
13+ 'redirect_uri ' => config ('authorizationserver.redirect_url ' ),
14+ 'response_type ' => 'token ' ,
15+ 'scope ' => 'place-orders ' ,
16+ ]);
17+
18+ return redirect (config ('authorizationserver.authorization_url ' ) . '? ' . $ query );
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments