Skip to content

Commit fb88095

Browse files
committed
docs: Update method name for exchanging authorization code
According to DocBlock, the `authenticate` function is deprecated, meaning its use is no longer recommended. Even though it may still work, I would recommend keeping the documentation as up to date as possible to prevent compatibility issues.
1 parent 6530c6b commit fb88095

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/oauth-web.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ After completing the OAuth 2.0 flow, you should be redirected to `http://localho
258258

259259
After the web server receives the authorization code, it can exchange the authorization code for an access token.
260260

261-
To exchange an authorization code for an access token, use the `authenticate` method:
261+
To exchange an authorization code for an access token, use the `fetchAccessTokenWithAuthCode` method:
262262

263263
```php
264-
$client->authenticate($_GET['code']);
264+
$client->fetchAccessTokenWithAuthCode($_GET['code']);
265265
```
266266

267267
You can retrieve the access token with the `getAccessToken` method:
@@ -361,7 +361,7 @@ if (! isset($_GET['code'])) {
361361
$auth_url = $client->createAuthUrl();
362362
header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
363363
} else {
364-
$client->authenticate($_GET['code']);
364+
$client->fetchAccessTokenWithAuthCode($_GET['code']);
365365
$_SESSION['access_token'] = $client->getAccessToken();
366366
$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/';
367367
header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));

0 commit comments

Comments
 (0)