@@ -19,24 +19,15 @@ class OAuth2Flow extends OAuthFlow {
1919 * @param string|util.URI $callback
2020 * @param string[] $scopes
2121 */
22- public function __construct ($ auth , $ tokens , $ consumer , $ callback = null , $ scopes = ['user ' ]) {
22+ public function __construct ($ auth , $ tokens , $ consumer , $ callback = ' / ' , $ scopes = ['user ' ]) {
2323 $ this ->namespace = 'oauth2::flow ' ;
2424 $ this ->auth = $ auth instanceof URI ? $ auth : new URI ($ auth );
2525 $ this ->backend = $ tokens instanceof OAuth2Endpoint
2626 ? $ tokens ->using ($ consumer )
2727 : new OAuth2Endpoint ($ tokens , $ consumer )
2828 ;
29-
30- // BC: Support deprecated constructor signature without callback
31- if (is_array ($ callback ) || null === $ callback ) {
32- trigger_error ('Missing parameter $callback ' , E_USER_DEPRECATED );
33- $ this ->callback = null ;
34- $ this ->scopes = $ callback ?? $ scopes ;
35- } else {
36- $ this ->callback = $ callback instanceof URI ? $ callback : new URI ($ callback );
37- $ this ->scopes = $ scopes ;
38- }
39-
29+ $ this ->callback = $ callback instanceof URI ? $ callback : new URI ($ callback );
30+ $ this ->scopes = $ scopes ;
4031 $ this ->rand = new Random ();
4132 }
4233
@@ -87,9 +78,9 @@ public function authenticate($request, $response, $session) {
8778 return ByAccessToken::from ($ token );
8879 }
8980
90- // Enter authentication flow, resolving callback URI against the curren request.
81+ // Enter authentication flow, resolving callback URI against the current request.
9182 $ uri = $ this ->url (true )->resolve ($ request );
92- $ callback = $ this -> callback ? $ uri ->resolve ($ this ->callback ) : $ this -> service ( $ uri );
83+ $ callback = $ uri ->resolve ($ this ->callback );
9384
9485 // Check whether we are continuing an existing authentication flow based on the
9586 // state given by the server and our session; or if we need to start a new one.
0 commit comments