@@ -8,16 +8,21 @@ class FacebookStrategy extends OpauthStrategy {
8
8
'scope ' => 'email ' , // Default scope for necessary permissions
9
9
);
10
10
11
- private $ api_version = 'v12 .0 ' ; // Update to the latest supported version
11
+ private $ api_version = 'v17 .0 ' ; // Update to the latest supported version
12
12
13
13
public function request () {
14
- $ url = "https://www.facebook.com/ {$ this ->api_version }/dialog/oauth " ;
15
14
$ params = array (
16
15
'client_id ' => $ this ->strategy ['app_id ' ],
17
16
'redirect_uri ' => $ this ->strategy ['redirect_uri ' ],
18
17
'scope ' => $ this ->strategy ['scope ' ],
19
18
);
20
19
20
+ if (!empty ($ this ->strategy ['api_version ' ])) {
21
+ $ params ['api_version ' ] = $ this ->strategy ['api_version ' ];
22
+ $ this ->api_version = $ this ->strategy ['api_version ' ];
23
+ }
24
+ $ url = "https://www.facebook.com/ {$ this ->api_version }/dialog/oauth " ;
25
+
21
26
// Other optional parameters
22
27
if (!empty ($ this ->strategy ['state ' ])) $ params ['state ' ] = $ this ->strategy ['state ' ];
23
28
if (!empty ($ this ->strategy ['response_type ' ])) $ params ['response_type ' ] = $ this ->strategy ['response_type ' ];
@@ -114,6 +119,10 @@ private function me($access_token) {
114
119
$ fields = $ this ->strategy ['fields ' ];
115
120
}
116
121
122
+ if (!empty ($ this ->strategy ['api_version ' ])) {
123
+ $ this ->api_version = $ this ->strategy ['api_version ' ];
124
+ }
125
+
117
126
$ me = $ this ->serverGet (
118
127
"https://graph.facebook.com/ {$ this ->api_version }/me " ,
119
128
array (
0 commit comments